heroku postgressql db迁移错误

heroku postgressql db迁移错误

问题描述:

我在尝试迁移heroku中的postgres数据库时出现错误。 首先我得到了:heroku postgressql db迁移错误

$ heroku run rake db:migrate --trace 
rake aborted! 
undefined method `find_by_name' for Gem::Specification:Class 
/app/lib/tasks/auto_annotate_models.rake:22:in `<top (required)>' 
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/depen          dencies.rb:245:in `load' 
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/depen          dencies.rb:245:in `block in load' 
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/depen          dencies.rb:236:in `load_dependency' 
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/depen          dencies.rb:245:in `load' 
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:425:in `b          lock in load_tasks' 
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:425:in `e          ach' 
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/engine.rb:425:in `l          oad_tasks' 
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/application.rb:145:          in `load_tasks' 
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/railtie/configurabl          e.rb:30:in `method_missing' 
/app/Rakefile:7:in `<top (required)>' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `lo          ad' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `lo          ad_rakefile' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:583:in `r          aw_load_rakefile' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:89:in `bl          ock in load_rakefile' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `s          tandard_exception_handling' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:88:in `lo          ad_rakefile' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:72:in `bl          ock in run' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `s          tandard_exception_handling' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `ru          n' 
/app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.3/bin/rake:33:in `<top (required)>' 
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `load' 
/app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `<main>' 

有谁知道发生了什么事?

+0

我认为你应该发布你的Gemfile。很难说出了什么问题,我不明白这一点:“然后我在Gemfile中添加了ruby”1.9.3“,然后我得到了” – rainkinz 2013-02-08 20:50:36

+0

神圣的文本墙蝙蝠侠! – rfusca 2013-02-08 23:50:38

+0

我不认为'find_by_name'或任何'find_by_xxxxx'默认支持......是吗? – courtsimas 2014-02-18 23:14:44

您是否在做迁移之前做过heroku运行rake db:create?

+0

试过,但没有帮助。 稍后找到该问题。这是一个来自annotate gem的脚本,不知道这是旧脚本还是其他人在我正在处理的项目中添加它。我已经删除了脚本,现在它正在工作。谢谢。 – 2013-02-15 23:24:59