0

I am getting the following error when I try to run bundle install

Bundler::GemspecError: Could not read gem at /usr/local/rvm/gems/ruby-1.9.3-p484@rails3tutorial/cache/turbolinks-2.1.0.gem. It may be corrupted.

An error occurred while installing turbolinks (2.1.0), and Bundler cannot continue.
Make sure that `gem install turbolinks -v '2.1.0'` succeeds before bundling.

Even if in install the above said gem and rub bundle install it throws a similar error and asks me to make sure an another gem is installed and this goes on and on. I am using Rails 4.0.2 and ruby 1.9.3p484.

1
  • Try adding gem 'turbolinks' to your gemfile and then use bundle install.
    – Vucko
    Jan 7, 2014 at 9:20

2 Answers 2

2

Maybe the file cache got corrupted. Try:

bundle install --no-cache

If this does not work, delete the cache directory and try again:

rm -rf /usr/local/rvm/gems/ruby-1.9.3-p484@rails3tutorial/cache
bundle install
1
  • Hey Sparkplug, feedback won't hurt ;-)
    – AWM
    Jan 20, 2014 at 15:04
1

I just had this problem with the bcrypt gem

Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...

Bundler::GemspecError: Could not read gem at /data/code/mdweb/vendor/bundle/ruby/2.1.0/cache/bcrypt-3.1.7.gem. It may be
 corrupted.
An error occurred while installing bcrypt (3.1.7), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.7'` succeeds before bundling.

The /data/code/mdweb/vendor/bundle/ruby/2.1.0/cache/bcrypt-3.1.7.gem file was 0 bytes; removing this file or using the --no-cache option didn't help.

Using gem install bcrypt -v '3.1.7' did work, so I copied ~/.gem/ruby/2.1.0/cache/bcrypt-3.1.7.gem to /data/code/mdweb/vendor/bundle/ruby/2.1.0/cache/bcrypt-3.1.7.gem and that allowed me to continue. You could also fetch the .gem file from http://rubygems.org if you can't find it on your system.

I suspect there's some sort of connection issue with bundler (but not with gem for some reason); I suspect DNS since there's an unusual long wait before I get an error, but didn't investigate further.

1
  • Wow, yeah, I just ran into this and manually downloading the .gem file from rubygems.org did the trick (there's a link in the sidebar called "download"). Wow, that's a bad bug... Mar 1, 2017 at 4:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.