LoginSignup
7
6

More than 5 years have passed since last update.

bundle config --local

Posted at

bundle config問題

例えば今だと、Mac EI Capitan(10.11.4), XCode 7.3 でlibv8がインストール出来ないからwith-system-v8を使いましょう、みたいな話題があって、こんな感じでやればインストールできるよ、というようなノウハウが回っている。

brew tap homebrew/versions
brew uninstall v8
brew install v8-315
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8-315)
bundle update

これはこれでいい(仕方ない)んだけど、たぶん数ヶ月すると、libv8のバージョンが上がって、今度はwith-system-v8はしないほうがいいというノウハウが出まわることが予想される。

OS X El Capitanでlibv8 / therubyracerのbundle installに失敗する問題の解決方法
http://qiita.com/ganta/items/53f616b48e94d989952f

でもってその時今やっているプロジェクトがリリースの佳境でライブラリのバージョンをおいそれと変えられないのに、内職しているプロジェクトの方で別途bundle installしようとすると、どっちかは動くんだけどどっちかは動かなくなる問題が予想される。そういう問題を起こさないためのbundlerじゃなかったの!

bundle config --localのご提案

bundle configで設定した値は、~/.bundle/config に保存される。場所から想像がつくとおり、この設定はユーザーについて回るから、プロジェクトAでもBでも同じ設定が適用される。libv8のバージョンなんてプロジェクト依存するものをグローバルに扱おうとしているのがおかしい。

bundlerの設定はプロジェクト単位でも保存できるんだから、libv8の設定なんかは、プロジェクト単位に保存した方がいいはず。そういう設定はきっとあるはず...

Executing bundle config --local will set that configuration to the local application. The configuration will be stored in app/.bundle/config.

man bundle-config

ということで、bunder config でlibv8の設定をあれこれいじるときは、bundle config --localを使ったほうが良さそうです。

7
6
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
7
6