【问题标题】:heroku db:migrate abortedheroku db:迁移中止
【发布时间】:2013-03-20 20:43:59
【问题描述】:

我是 Ruby on Rails 和 heroku 的新手。我按照视频教程中的步骤进行操作。我不认为我做了什么不同的事情。但是,当一切都在我的 localhost:3000 上运行时,我无法在 heroku 上运行 rake db:migrate 另外能否详细说明 GEMFILE.lock 和 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'

我的 GEMFILE 的相关内容

group :production do
  gem 'pg'
end

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

我的 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)

【问题讨论】:

    标签: ruby-on-rails heroku heroku-toolbelt


    【解决方案1】:

    有时,当您创建项目时,“服务器实例”无法正常运行,无论出于何种原因,heroku 无法让一切正常运行。我也花了几个小时把头撞在墙上,只有当我创建一个新的 repo 并使用新的 heroku 实例重新开始时才发现一切正常。这就是为什么我从 Heroku 搬走并直接找到源头并获得 Amazon EC2 的原因之一,正如您从上面的错误中看到的那样,这正是 Heroku 使用的。

    【讨论】:

      【解决方案2】:

      我猜这是由 Heroku 问题引起的临时错误,而不是您的项目问题。我会每隔一段时间再试一次。

      我发现 this article 很好地介绍了 gemfile(和 gemfile.locks)的方式和原因。

      【讨论】:

        【解决方案3】:

        这与您的代码或 ruby​​ on rails 无关。

        这是一个 DNS 错误,如果您的 Rails 应用程序和 Heroku 中的 db(这是默认设置),然后尝试获得 heroku 支持,并继续尝试,一旦更新 dns 它应该可以工作,但只是以防万一,请尝试联系 Heroku 支持,他们应该能够很快解决问题。

        【讨论】:

        • 我已经尝试了大约 7 个小时。每次我得到同样的错误。我已向 Heroku 支持团队提出请求。
        • 一直在等待,这绝对是heroku网络中的DNS问题。
        猜你喜欢
        • 2011-04-21
        • 2012-09-08
        • 2023-03-04
        • 2013-01-10
        • 2013-02-01
        • 1970-01-01
        • 2011-08-05
        • 1970-01-01
        相关资源
        最近更新 更多