PostgreSQLでRails 5をデプロイして、Herokuでアプリを無料にする。これはdatabase.yml
から私の設定です:Heroku、PosgreSQL with Rails 5でマイグレーションを実行するとエラーが発生する
production:
adapter: postgresql
username: root
password:
database: example
私はheroku run rake db:migrate
を実行すると、私はこのエラーを参照してください。
rake aborted! PG::ConnectionBad: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
私はdatabase.yml
に次の行を追加する場合:
host: localhost
と再び移行を実行しますこのエラーが表示されます:
rake aborted! PG::ConnectionBad: could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?
修正方法?
あなたは印刷することができます'heroku config --app your_app_name'コマンドの出力? –
LANG:EN_US.UTF-8 RACK_ENV:生産 RAILS_ENV:生産 RAILS_LOG_TO_STDOUT: RAILS_SERVE_STATIC_FILESを有効にします。https:// githubの 'rails_12factor'は一切のRails 5.チェックドキュメンテーションのために必要とされる – gdfgdfg