LoginSignup
3
5

More than 3 years have passed since last update.

【Ubuntu】DockerでRuby on Railsの環境構築中にPermissionErrorが起きる

Posted at

背景

Ubuntu上から上記に従ってすすめると以下のコマンド実行時にでエラーが出る
$ docker-compose run web rails new . --force --no-deps --database=postgresql

【エラー内容】
PermissionError: [Errno 13] Permission denied: '***/myapp/tmp/db'

原因

rails new実行時に作成されるmyapp/tmp/dbの所有者がrootになっているためコマンドが正常に動作しない模様

解決策

myappディレクトリ直下で以下を実行し/tmp/dbの所有者をログイン中のユーザーへ変更
sudo chown -R $USER:$USER .

参考

3
5
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
3
5