如果gem安装在vendor/gems中,为什么Rails(2.3.4)会抱怨它缺失?
问题描述:
我在我的vendor/gems
目录中有RedCloth
宝石。如果gem安装在vendor/gems中,为什么Rails(2.3.4)会抱怨它缺失?
我也有这个在我的environment.rb
:
config.gem 'RedCloth'
那么,为什么Rails的抱怨宝石丢失:
Missing these required gems:
RedCloth
还有什么它需要认识到,我把它安装在vendor/gems
目录?
environment.rb
:
RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
config.gem 'RedCloth'
config.plugins = [ :all ]
config.action_controller.session_store = :active_record_store
config.time_zone = 'UTC'
end
答
这是因为config.gem尝试需要 'RedCloth',但你必须需要 'redcloth'
config.gem 'RedCloth', :lib => 'redcloth'
答
rake gems:build
@chuck,这就是我告诉你在另一篇文章中,如果你将gem解包到vendor/gems中,你仍然需要'rake gems:build' – jordinl 2010-09-10 15:27:54