rake db:migrate错误,'task'是未定义的方法

试图运行rake db:migrate,返回一个错误。

然后用--trace再次运行它,这里是错误:

Paul-Denlingers-MacBook-Pro:things_i_bought pdenlinger$ rake db:migrate --trace

耙子中止了! 未定义的方法task' for #<ThingsIBought::Application:0x00000101679880> /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:215:in initialize_tasks'/Users/ load_tasks' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:77:in ruby- load_tasks' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:77:in gems/ load_tasks' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:77:in rails/ load_tasks' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:77:in in load_tasks' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.7/lib/rails/application.rb:77:in method_missing'/ Users / pdenlinger / rails_projects / things_i_bought / Rakefile:7:in <top (required)>' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/rake_module.rb:25: <top (required)>' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in load'/Users/pdenlinger/.rvm/gems /ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:495:in pdenlinger/ load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:495:in ruby- load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:495:in raw_load_rakefile'/Users load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:495:in pdenlinger load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:495:in .rvm load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:495:in gems load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:495:in ruby-1.9.2-p0 load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:495:in gems load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:495:in .rb:78: block in load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:129:in standard_exc eption_handling'/Users/ load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:61:in ruby- load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:61:in gems/ load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:61:in rake/ load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:61:in in load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:61:in pdenlinger/ load_rakefile' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:61:in在运行中的块'/Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/ gems / rake-0.9.0 / lib / rake / application.rb:129:in standard_exception_handling' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:59:in /gems/ standard_exception_handling' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:59:in -p0/gems/rake-0.9.0/lib/rake standard_exception_handling' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/lib/rake/application.rb:59:in run'/Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.9.0/bin/rake:31:in <top (required)>' /Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in load'/Users/pdenlinger/.rvm/gems/ruby-1.9.2-p0/bin/rake:19 :在``

它说'任务'是一个未定义的方法; 这是什么意思? 我能做些什么来解决它?

运行Rails 3.0.7


看看这个问题。 您可以恢复到您的Gemfile中的耙0.8.7或修补您的Rakefile。


也许这会有所帮助。 - > Gist:破坏的rakefile


Rake 0.9.0打破了一些东西。

同时,请尝试:

bundle exec rake db:migrate
链接地址: http://www.djcxy.com/p/49937.html

上一篇: rake db:migrate error, 'task' is undefined method

下一篇: jQuery Ajax Submit Post not getting success message back