2012-02-10 67 views
5

運行:紅寶石1.9.3p0使用Rails 3.2.1「軌生成RSpec的:安裝」似乎沒有

嘗試使用rspec的,但是當我嘗試把它安裝到我的應用程序,我得到以下錯誤:

/Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `generators' for #<Rails::Railtie::Configuration:0x00000101b2f1b8> (NoMethodError) 
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:4:in `<class:Railtie>' 
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:3:in `<module:Rails>' 
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:2:in `<module:RSpec>' 
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:1:in `<top (required)>' 
from /Users/Si/.rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `require' 
from /Users/Si/.rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `block (2 levels) in require' 
from /Users/Si/.rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `each' 
from /Users/Si/.rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `block in require' 
from /Users/Si/.rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `each' 
from /Users/Si/.rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `require' 
from /Users/Si/.rvm/gems/[email protected]/gems/bundler-1.0.22/lib/bundler.rb:122:in `require' 
from /Users/Si/dropbox/sh_rails_projects/test_app/config/application.rb:13:in `<top (required)>' 
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:24:in `require' 
from /Users/Si/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:24:in `<top (required)>' 
from script/rails:6:in `require' 
from script/rails:6:in `<main>' 

我對rails和ruby很新,所以這對我來說幾乎沒有任何意義,任何人都可以解釋。

感謝

+0

你在'Gemfile'中有什麼? – James 2012-02-11 00:04:54

回答

11

它看起來像你的RSpec的護欄版本2.0.0.beta ... 嘗試升級這〜> 2.8,或者如果這是你已經在你的Gemfile指定的內容,運行bundle exec rails g rspec:install

要更新版本的寶石,你的Gemfile您應該具備以下條件:

group :test, :development do 
    gem "rspec-rails", "~> 2.8" 
end 

一旦你補充說,運行bundle update rspec-rails然後再次嘗試安裝,一切都應該一諾千金!

+0

我會給這個去 – user1190654 2012-02-11 22:43:03

+0

謝謝。這工作! – kabir 2012-06-18 17:07:12

+0

感謝好友... – 2013-01-22 11:15:21