2010-09-10 76 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

相關問題