gemfileを書き換えた際のエラー対処法について後発者のためにメモを残しておく。
開発環境
windows 10 home
ubuntu 20.04 LTS
ruby 2.7.1
Rails 6.0.3
postgresql 11
エラー文
$ bundle
~~~~~中略~~~~~
Permission denied @ rb_sysopen - /home/admin0/taskleaf2/Gemfile (Errno::EACCES)
~~~~~中略~~~~~
was an error while trying to read from `/home/admin0/taskleaf2/Gemfile`. It is likely that you need to grant read permissions for that path. (Bundler::PermissionError)
~~~~~中略~~~~~
Bundler::Dsl::DSLError
今回は特に理由はないが3つ目のエラー文着目に着目して検索したところ以下のサイトに良さげな解決方法が記載されていたので実行してみる
https://stackoverflow.com/questions/57926553/bundle-install-gives-bundlerdsldslerror
$ chmod 644 Gemfile
これでエラーが発生しなくなったため、問題解決したと判断する。