【发布时间】:2018-08-06 00:19:34
【问题描述】:
我不明白为什么我的db:schema:load 在 Heroku 上失败了。以下是详细信息。
heroku run rails db:schema:load --app appna DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=production
Running rails db:schema:load DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=production on ⬢ appname... up, run.3508 (Standard-1X)
This method is not allowed with this Ruby version. current: 2.5.1, allowed version: < 2.5.0
-- enable_extension("plpgsql")
D, [2018-08-06T00:12:27.213314 #4] DEBUG -- : SQL (2.8ms) CREATE EXTENSION IF NOT EXISTS "plpgsql"
D, [2018-08-06T00:12:27.229821 #4] DEBUG -- : ↳ db/schema.rb:16
-> 0.1128s
-- enable_extension("postgis")
D, [2018-08-06T00:12:27.497698 #4] DEBUG -- : SQL (256.9ms) CREATE EXTENSION IF NOT EXISTS "postgis"
D, [2018-08-06T00:12:27.501310 #4] DEBUG -- : ↳ db/schema.rb:17
rails aborted!
ActiveRecord::QueryCanceled: PG::QueryCanceled: ERROR: canceling statement due to statement timeout
: CREATE EXTENSION IF NOT EXISTS "postgis"
/app/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:603:in `async_exec'
我在 Rails 5.2、Postgres 10、pg gem 1.0 上。
【问题讨论】:
-
请阅读Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - 总结是这不是解决志愿者的理想方式,并且可能会适得其反。请不要将此添加到您的问题中。
-
看起来你有一个语句超时。你是在
database.yml中配置的吗?
标签: ruby-on-rails heroku pg heroku-postgres