1

我正在按照 Addison Wesley Ruby On Rails 书做一个教程,我目前正在学习 TDD。问题是我在安装 rspec 后使用 rake 时遇到问题,这是我在尝试“rake db:migrate”后从终端得到的:

    rake aborted!
undefined method `prerequisites' for nil:NilClass
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/rspec-rails-2.0.1/lib/rspec/rails/tasks/rspec.rake:3:in `<top (required)>'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/rspec-rails-2.0.1/lib/rspec-rails.rb:10:in `load'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/rspec-rails-2.0.1/lib/rspec-rails.rb:10:in `block in <class:Railtie>'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/railtie.rb:184:in `instance_exec'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/railtie.rb:184:in `block in load_tasks'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/railtie.rb:184:in `each'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/railtie.rb:184:in `load_tasks'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/engine.rb:423:in `block in load_tasks'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/railties.rb:8:in `each'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application/railties.rb:8:in `all'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/engine.rb:423:in `load_tasks'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/application.rb:145:in `load_tasks'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/Jay/rails_projects/sample_app/Rakefile:7:in `<top (required)>'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `eval'
/Users/Jay/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

我正在使用 rake 10.0.3 和 rspec 2.0.1

4

1 回答 1

1

您需要更新到更新版本的 rspec-rails gem 来解决这个问题。

于 2013-01-28T16:34:39.793 回答