1

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

$ 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>'

这是怎么回事?

4

1 回答 1

1

在进行迁移之前,您是否执行过 heroku run rake db:create?

于 2013-02-09T00:18:40.220 回答