LoginSignup
3
3

More than 5 years have passed since last update.

Vagrant共有ファイル内のRailsプロジェクトでbundle installできない

Posted at

問題

Vagrant上にRailsプロジェクトの開発環境を構築中、bundle installがどうしても上手くいかない事があった。

解決方法

はじめはgemの依存関係だと思ったが、Vagrantの共有フォルダの設定の問題だった。
共有フォルダ内のファイルの実行権限がない事が原因だった。

Vagrantfileで以下のように設定する。

config.vm.synced_folder ".", "/vagrant", owner: "vagrant", mount_options: ["dmode=777", "fmode=777"]

もしくは、権限が共有フォルダ内のファイル全てに適用されてしまうのを避けたい場合、オプションをnfcにしても上手くいく。

config.vm.synced_folder ".", "/vagrant/", type: "nfs"
3
3
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
3