1

I'm getting error when I try to migrate postgres database in heroku. First I got:

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

What's going on?

3
  • I think you should post your Gemfile. Hard to say what's wrong and I don't get this bit: "Then I added ruby "1.9.3" in Gemfile and then I got" Commented Feb 8, 2013 at 20:50
  • holy wall-of-text batman! Commented Feb 8, 2013 at 23:50
  • I don't think find_by_name or any find_by_xxxxx is supported by default anymore... is it? Commented Feb 18, 2014 at 23:14

1 Answer 1

1

Did you do heroku run rake db:create before you do your migrate?

Sign up to request clarification or add additional context in comments.

1 Comment

Tried that but didn't help. Found the issue later. it's a script from annotate gem, not sure if that was the old script or someone else added it in the project I'm working on. I've removed the script and it's now working. Thx.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.