3
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

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

Posted at

#背景
https://docs.docker.com/compose/rails/

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 .

###参考
https://forums.docker.com/t/permissionerror-errno-13-permission-denied-home-fred-docker-tmp-db/81168/2

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?