0
我正在運行Rails 3.1.1,並在運行此命令時出現此錯誤。很明顯,新的Rails,任何幫助讚賞:使用rake出現問題
rake中止! 未定義的方法'先決條件的零:NilClass
/Users/220040168/.rvm/gems/[email protected]/gems/rspec-rails-2.6.0/lib/rspec/rails/tasks/rspec.rake:3:in `<top (required)>'
/Users/220040168/.rvm/gems/[email protected]/gems/rspec-rails-2.6.0/lib/rspec-rails.rb:10:in `load'
/Users/220040168/.rvm/gems/[email protected]/gems/rspec-rails-2.6.0/lib/rspec-rails.rb:10:in `block in <class:Railtie>'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/railtie.rb:183:in `call'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/railtie.rb:183:in `block in load_tasks'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/railtie.rb:183:in `each'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/railtie.rb:183:in `load_tasks'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/engine.rb:396:in `block in load_tasks'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in `each'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/application/railties.rb:8:in `all'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/engine.rb:396:in `load_tasks'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/application.rb:103:in `load_tasks'
/Users/220040168/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/220040168/rails_projects/sample_app/Rakefile:7:in `<top (required)>'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/220040168/.rvm/gems/[email protected]/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/220040168/.rvm/gems/[email protected]/bin/rake:19:in `load'
/Users/220040168/.rvm/gems/[email protected]/bin/rake:19:in `<main>'
不是我第一次運行這個命令,但我第一次收到此錯誤。
的Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
group :development do
gem 'rspec-rails', '2.6.0'
end
group :test do
gem 'rspec', '2.6.0'
gem 'webrat', '0.7.1'
gem 'autotest', '4.3.2'
gem 'autotest-rails-pure', '4.1.0'
gem 'autotest-fsevent', '0.2.2'
gem 'autotest-growl', '0.2.4'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
Rails的版本?堆棧跟蹤?此外,搜索您的項目的先決條件,並查看是否有任何調用此方法。 –
請將它全部添加到您的答案。 –
加Gemfile可能會有幫助,因爲Gem依賴關係,我有類似的錯誤。 –