2013-05-07 96 views
5

我是Ruby on Rails的新手,我試圖從Internet中做一些示例。但是當我嘗試生成設計安裝時出現錯誤。 我修改了Gemfile,加入了gem devise。然後運行:嘗試生成設計時出錯:在Ruby on Rails中安裝

bundle install 

但是當我運行。

rails generate devise:install 

我有一個錯誤:

/usr/local/lib/ruby/gems/0.9.1/gems/devise-1.1.3/lib/devise.rb:193:in `mailer=': undefined method `ref' for ActiveSupport::Dependencies:Module (NoMethodError) 
    from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/lib/devise.rb:195:in `<module:Devise>' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/lib/devise.rb:4:in `<top (required)>' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in `require' 
    from /home/mihai/Desktop/blog/config/application.rb:7:in `<top (required)>' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:24:in `require' 
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:24:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

請幫幫我!

+0

您可以張貼在那裏你包括寶石 '設計' – poseid 2013-05-07 08:19:35

回答

6

Devise的版本比較陳舊。

你可以這樣做:

bundle update devise 

然後:

bundle install 

這應該升級設計的寶石。

+0

非常感謝您的Gemfile的一部分!它現在工作! – 23ars 2013-05-07 08:24:19

+0

太棒了!請在您喜歡的時候將答案標記爲正確。 – poseid 2013-05-07 08:27:25

0

它應該是:

rails generate devise_install 

,而不是:

rails generate devise:install