Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Bundler installation path to normal

In order to fix something unrelated to this, I did a bundle install --path vendor/cache. Now every time I use bundle install, the gems are being installed into 'vendor/cache'. How can I revert this so that a bundle install installs the gems into the normal directory?

Update bundle install --system makes no difference.

like image 415
Linus Avatar asked Dec 20 '22 12:12

Linus


2 Answers

In project directory after this command bundle install --path vendor/cache bundler create config file in .bundle/config that contain bundler config:

---
BUNDLE_PATH: vendor/cache
BUNDLE_DISABLE_SHARED_GEMS: '1'

Delete or edit this file for you need.

--path options. Bundler will remember this value for future installs on this machine

You can specify this setting when installing via bundle install /path/to/bundle. Bundler will remember where you installed the dependencies to on a particular machine for future installs, loads, setups, etc.

Also, you might want to check out ~/.bundle/config for the BUNDLE_PATH setting.

like image 118
Philidor Avatar answered Dec 30 '22 15:12

Philidor


Following these steps from the bundler.io website solved the problem:

# remove project-specific settings 
rm -rf .bundle/  
# remove project-specific cached gems and repos 
rm -rf vendor/cache/  
# remove the saved resolve of the Gemfile 
rm -rf Gemfile.lock  
# uninstall the rubygems-bundler and open_gem gems 
rvm gemset use global 
# if using rvm 
gem uninstall rubygems-bundler open_gem  
# try to install one more time bundle install
like image 21
Linus Avatar answered Dec 30 '22 15:12

Linus