- 環境
Windows10上でUbuntuを利用(Windows Subsystem for Linux)
Ubuntu:18.04.1 LTS
Ruby:2.6.1p33 (2019-01-30 revision 66950)
Rails:5.2.2
Postgresql:11.2 (Ubuntu 11.2-1.pgdg18.04+1)
- 状況と解決したい事
- postgresqlをインストール後、起動 ←問題無く起動できました。
- rails new scaffold_app -d postgresqlを実行 ←問題無く実行できました。
- scaffold_appフォルダにて、bin/rails db:createを実行←下記のメッセージ
- 再度、postgresqlを起動←下記のメッセージ(★今ここ)
データベースを正常に起動したいです。ご教示いただけますと幸いです。
$ bin/rails db:create 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"? Couldn't create 'scaffold_app_development' database. Please check your configuration. rails 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"? /mnt/d/Users/yuki/study/ruby/Code/scaffold_app/bin/rails:9:in `<top (required)>' /mnt/d/Users/yuki/study/ruby/Code/scaffold_app/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>' Tasks: TOP => db:create (See full trace by running task with --trace)
~$ sudo service postgresql start * Starting PostgreSQL 11 database server * Error: /usr/lib/postgresql/11/bin/pg_ctl /usr/lib/postgresql/11/bin/pg_ctl start -D /var/lib/postgresql/11/main -l /var/log/postgresql/postgresql-11-main.log -s -o -c config_file="/etc/postgresql/11/main/postgresql.conf" exited with status 1: 2019-02-24 21:30:42.607 DST [320] LOG: listening on IPv4 address "127.0.0.1", port 5432 2019-02-24 21:30:42.618 DST [320] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2019-02-24 21:30:42.699 DST [321] LOG: database system was interrupted; last known up at 2019-02-24 20:35:40 DST 2019-02-24 21:30:42.700 DST [321] PANIC: could not flush dirty data: Function not implemented 2019-02-24 21:30:42.700 DST [320] LOG: startup process (PID 321) was terminated by signal 6: Aborted 2019-02-24 21:30:42.700 DST [320] LOG: aborting startup due to startup process failure 2019-02-24 21:30:42.710 DST [320] LOG: database system is shut down pg_ctl: could not start server Examine the log output.
検索すれば引っかかると思うのですが、↓に同じ質問があるので、参考にしてください。
https://teratail.com/questions/176005
個人的にはWSLは、すでにUbuntuを使ったことがある人で、WSL固有の問題に自分で対処できる人だけ使って欲しいです。ライトにちょっとお勉強用とかならさほど問題もなさそうですけどね。
あなたの回答
tips
プレビュー