皆様、こんにちは。
###前提・実現したいこと
Cloud9でRuby2.3、Ruby on Rails4.2.5を使ってAction Mailerを実装しようとしていますが、$ bin/rails db:migrate実行時にエラーが出ます。
「Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?」といエラー分を見るに、postgresqlのポート番号が違うよ、といわれているような気がするのですが、どのファイルで設定するのかわかりませんorz
実装の参考にしているページ
https://railsguides.jp/action_mailer_basics.html
↑の「2.1.4 メイラーを呼び出す」で躓いています。
また、エラー内容で出るパス(/usr/local/rvm/gems/...) はどこから辿れるのでしょうか?
ローカルで開発していたときは楽々辿れたのですが、Cloud9ではそもそもどこに置かれているのかがまったくわからず。。。
どなたか知恵をお貸しください。よろしくお願いします(>_<)
###発生している問題・エラーメッセージ
yukiya025:~/workspace (mailer) $ rake db:migrate rake aborted! PG::ConnectionBad: could not connect to server: Connection refused Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? /usr/local/rvm/gems/ruby-2.3.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize' ... ... ...
###該当のソースコード
default: &default adapter: postgresql # sqlite3から変更 pool: 5 timeout: 5000 development: <<: *default database: db/development.postgresql #sqlite3から変更 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: db/test.postgresql #sqlite3から変更 production: <<: *default database: db/production.postgresql #sqlite3から変更
###試したこと
・herokuデプロイ時にGemfileの内容をsqlite3からpgへ変更。
・database.ymlにあったsqlite3もpostgresqlに変更 (上記のソースコードの通り)。
・$ rake db:migrateで実行。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/14 03:46 編集