Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundle install tries to use cache file

When i try to do bundle install, my gem_path and gem_home point to /usr/local/rvm/gems/ which i don't have write access and it fails because of invalid permissions. because of this i've changed both paths to a local directory where i do have write access.

when doing so, i do a bundle install, i get :

bruno@test6:~$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..

Bundler::GemspecError: Could not read gem at   /afs/varda.io/user/b/br/bruno/test6/cache/rake-10.1.0.gem. It may be corrupted.
An error occurred while installing rake (10.1.0), and Bundler cannot continue.
Make sure that `gem install rake -v '10.1.0'` succeeds before bundling.

well, if i do a gem install, it works just fine.

but bundle would just not work; even if a try to delete the cache folder that it complains about.

i did try "bundle install --no-cache" and it fails in the same way. (bundle install --deployment works fine too) how do i get bundle install to work ?

i've spent quite a bit of time, if anyone would have any guidance , i would really appreciate it!

like image 702
elcomputerguy Avatar asked Sep 08 '13 23:09

elcomputerguy


People also ask

What is bundle cache?

The bundle cache is a cell-wide store (or server-wide for single-server systems) of bundles that are referenced by OSGi applications, and that have been downloaded from both internal and external repositories.

Why bundle install is installing gems in vendor bundle?

In deployment, isolation is a more important default. In addition, the user deploying the application may not have permission to install gems to the system, or the web server may not have permission to read them. As a result, bundle install --deployment installs gems to the vendor/bundle directory in the application.

What is the difference between bundle install and bundle update?

bundle update and bundle install can both install the gems you specified in Gemfile but missing in gems. But bundle update does one thing more to upgrade: If the gems specified in Gemfile don't have version, it will upgrade to whatever latest.


1 Answers

Fixed it by deleting cache file and re-running bundle install.

rm -rf <location_of_cache>. In your case:

rm -rf /afs/varda.io/user/b/br/bruno/test6/cache
like image 166
Oleg Rogov Avatar answered Sep 23 '22 08:09

Oleg Rogov