Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bundle install and RVM

I've run "bundle install" on an existing Rails 3 app which has the gems in vendor/cache (I guess they were packed via "bundle package" before) and valid Gemfile and Gemfile.lock files.

What I saw is, it created a folder .bundle in my home dir.

I am using also RVM. When I tried "gem list", I didn't see any of the gems in vendor/cache installed.

Am I doing something wrong? Everywhere the bundler articles say, execute "bundle" or "bundle install" to install the gems in the Gemfile and Gemfile.lock files. Is the problem connected with the RVM usage?

Thanks for any advice.

like image 971
Emil Petkov Avatar asked Apr 25 '11 00:04

Emil Petkov


2 Answers

If you give an argument to bundle install, it will keep installing the gems inside this directory, even if you rm -rf that directory and start from scratch with the pure bundle install, as noted in Emil's comment. This new directory is taken by default by bundler, and it even supersedes what you declare in the .rvmrc file.

To remove this constraint, simply edit the .bundle/config file and delete the file declaring BUNDLE_PATH, e.g.,

BUNDLE_PATH: /usr/local/lib/
like image 181
Marius Butuc Avatar answered Sep 18 '22 18:09

Marius Butuc


Look in rvm env gemdir, also check what you've got set in .rvmrc in terms of a gemset. Do bundle install and it should get all the gems.

Check .bundle by doing $ cat .bundle to see its content , and check if it is copying the gems to vendor/ruby. This will only be the case if bundle install --path vendor/ruby was supplied (Ref).

like image 41
Michael De Silva Avatar answered Sep 19 '22 18:09

Michael De Silva