heroku db:migrate aborted
Asked Answered
S

3

6

I am new to Ruby on Rails and heroku. I followed the steps in a video tutorial. I don't think I did anything different. However, I am not able to run rake db:migrate on heroku while everything works on my localhost:3000 Also can you elaborate on the functionality of GEMFILE.lock and GEMFILE.

$ heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.9550
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
Connecting to database specified by DATABASE_URL
rake aborted!
could not translate host name "ec2-54-225-69-193.compute-1.amazonaws.com" to address: Temporary failure in name resolution
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `connect'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'

Relevant contents of my GEMFILE

group :production do
  gem 'pg'
end

group :development, :test do
  gem 'sqlite3'
end

Relevant contents of my GEMFILE.lock

    sqlite3 (1.3.7)
    thor (0.18.0)
    tilt (1.3.6)
    treetop (1.4.12)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.37)
    uglifier (1.3.0)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)

PLATFORMS
  ruby

DEPENDENCIES
  coffee-rails (~> 3.2.1)
  jquery-rails
  pg
  rails (= 3.2.13)
  sass-rails (~> 3.2.3)
  sqlite3
  uglifier (>= 1.0.3)
Struble answered 30/3, 2013 at 5:19 Comment(0)
D
4

That's nothing related your code or ruby on rails.

Its a DNS error, if you have your rails app and the db within Heroku (which is the default), then try to reach heroku support, and just kept trying, once the dns is updated it should be working, but just in case, try to contact Heroku Support, they should be able to fix the issue pretty quickly.

Devindevina answered 30/3, 2013 at 5:25 Comment(2)
I have been trying it for around 7 hours now. Every time I get the same error. I have raised a ticket with Heroku support team.Struble
Just kept trying and wait, its definitely a DNS issue within heroku network.Devindevina
A
1

I'm guessing that is a temporary error that's caused by a problem with Heroku, rather than with your project. I would try it again every once in a while.

I find this article to be a good introduction to the hows and whys of gemfiles (and gemfile.locks).

Antony answered 30/3, 2013 at 5:25 Comment(0)
S
1

Sometimes when you create the project the 'server instances' just doesn't work out correctly, for what ever reason heroku fails to get everything working correctly. I too have spent hours banging my head against a wall, to only find out everything works fine when I create a new repo and start over again with a new heroku instance. Thats one of the reasons why I moved away from Heroku and just went strait to the source and got an Amazon EC2, which as you can see from the above error is exactly what Heroku uses.

Skald answered 30/3, 2013 at 6:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.