2010-09-10 71 views
0

我在我的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 

回答

1

这是因为config.gem尝试需要 'RedCloth',但你必须需要 'redcloth'

config.gem 'RedCloth', :lib => 'redcloth' 
+0

@chuck,这就是我告诉你在另一篇文章中,如果你将gem解包到vendor/gems中,你仍然需要'rake gems:build' – jordinl 2010-09-10 15:27:54

1

如果您使用Rails 3则需要在Gemfile指定它。

+0

您可以使用Gemfile中使用Rails的2.2.x太 – shingara 2010-09-10 18:40:18

相关问题