2012-02-10 41 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