LoginSignup
0
0

Ruby on Railsの勉強環境の作成

Posted at

メインで参考にしたサイト

Ruby 3.x, Rails 7.x, PostgreSQL の Docker 環境構築 2023 #Rails - Qiita

途中以下のエラーが発生

bash
$ docker compose run frontend rails db:create
[+] Creating 1/0
 ✔ Container free-market-app-backend-1  Running                                                                                0.0s 
FATAL:  could not open file "global/pg_filenode.map": Permission denied
Couldn't create 'myapp_development' database. Please check your configuration.
rails aborted!
ActiveRecord::ConnectionNotEstablished: FATAL:  could not open file "global/pg_filenode.map": Permission denied (ActiveRecord::ConnectionNotEstablished)


Caused by:
PG::ConnectionBad: FATAL:  could not open file "global/pg_filenode.map": Permission denied (PG::ConnectionBad)

Tasks: TOP => db:create
(See full trace by running task with --trace)

解決策

ホストマシン上で以下のコマンドを実行してtmo/dbの権限を付与して解決した

bash
# ホストマシン上で実行
sudo chown -R 1000:1000 ./tmp/db
sudo chmod -R 700 ./tmp/db
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0