2012-01-13 54 views
3

劇透:這是rspec-rails寶石過時的版本! 「:遷移耙分貝」,以確保一切仍然工作rake中止!未定義的方法'先決條件的零:NilClass

我感動我的sqlite3的寶石成開發區塊,然後運行後,遇到這個錯誤與我的Rails項目目錄發出任何rake命令。 Rake在我係統的其他地方工作正常。但是,任何耙的任務,我在該目錄中運行給我下面的輸出與跟蹤:

/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rspec-rails-2.0.0.beta.18/lib/rspec/rails/tasks/rspec.rake:3:in `<top (required)>' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:8:in `load' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rspec-rails-2.0.0.beta.18/lib/rspec-rails.rb:8:in `block in <class:Railtie>' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie.rb:183:in `call' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie.rb:183:in `block in load_tasks' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie.rb:183:in `each' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie.rb:183:in `load_tasks' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/engine.rb:396:in `block in load_tasks' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application/railties.rb:8:in `each' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application/railties.rb:8:in `all' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/engine.rb:396:in `load_tasks' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/application.rb:103:in `load_tasks' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing' 
/Users/ianyoung/rails/third_app/Rakefile:7:in `<top (required)>' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load' 
/Users/ianyoung/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>' 

我得到的第一個錯誤是問題的標題: 耙中止!未定義的方法'先決條件的零:NilClass

我也一直得到這個,但它尚未引起我的問​​題。也許它是相關的嗎?:

退化警告:在Rails :: Railtie中的config.generators已被棄用。請改用config.app_generators。 (從/Users/ianyoung/rails/third_app/config/application.rb:13調用) 棄用警告:在Rails的config.generators :: Railtie已被棄用。請改用config.app_generators。 (從/Users/ianyoung/rails/third_app/config/application.rb:13調用)

+1

爲什麼你使用rspec-rails的舊版本? – 2012-01-13 23:05:48

+0

這是rspec-rails的一個非常舊的版本,很可能會被更新版本的rake破壞。我會嘗試首先更新rspec-rails – 2012-01-13 23:07:06

+0

你更新了Rubygems嗎? – eveevans 2012-01-13 23:08:26

回答

3

更新到最新的RSpec的護欄寶石消除了我這個問題,並棄用警告。

安裝最新webrat寶石解決失蹤has_selector?方法問題,因爲某種原因,我認爲這是比我過時的rspec-rails gem更大的罪惡。一切都很好。

謝謝你的有用的意見。

相關問題