LoginSignup
125
102

More than 5 years have passed since last update.

railsでbundle installする時にインストールパスを指定

Last updated at Posted at 2016-05-05

bundlerでフツーにインストールすると

console
$bundle install

=>システムのrubyにインストールされる模様。
私の環境ではrbenvを使っていたので、
$HOME/.rbenv/versions/<current version>/lib/ruby/gems/<target version>/gems
に入ってました。

インストールパスを指定しよう

console
$bundle install --path vendor/bundle

これでProjectディレクトリ配下のvendor/bundleディレクトリ内にgemがインストールされるようになります。

このオプションを追加することで何が変わる?

Projectディレクトリ配下にある.bundleディレクトリ内のconfigファイルに設定が追記される。

Project/.bundle/config
---
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: '1'

なので、次回以降はオプションを指定する必要がない。

console
$bundle install

でok。

125
102
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
125
102