いつもお世話になっております。いつもteratailで勉強させてもらってます。
AWS cloud9を使ってRailsでサイトをherokuで公開しました。
ここからsqliteからpostgresへの移行をしたいのですが、postgresコマンド
が使えなくて挫折しています。
エラーメッセージ
ec2-user:~/environment/NBA_app (master) $ createdb "dbname"
createdb: could not connect to database template1: 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"?
移行した過程
postgresqlをダウンロードしてインストール
環境変数の変更↓
export PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH"
ダンプファイルの作成↓
sqlite3 .dump > sqlite_dumpfile.sql
postgresのデータベースの作成
$createdb "dbname"
ここでエラー
createdb: could not connect to database template1: 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"?
試したコマンド
$ rm /usr/local/var/postgres/postmaster.pid
rm: cannot remove ‘/usr/local/var/postgres/postmaster.pid’: No such file or directory
$ sudo service postgresql start
postgresql: unrecognized service
ググっても解決にいたらなかったので、ギブアップです。
パスが原因でしょうか?
もしよろしければ解決策をお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/02 01:12
2018/08/02 01:13
2018/08/02 04:02