Ruby-on-rails – Bundler cannot find a version of a gem, but gem install with the same name works

bundlergemfileruby-on-rails

I've created a gem, and for some reason this one keeps bugging me, and refuses to install properly through bundler.

Here's the Gemfile:

source 'https://rubygems.org'
gem 'rails', '3.2.9'
gem "switch_access-rails", "~> 1.1.6"

bundle install fails with:

Could not find gem 'switch_access-rails (~> 1.1.6) ruby' in the gems available on this machine.

This works:

gem install switch_access-rails -v 1.1.6 

And the gem is here on rubygems: https://rubygems.org/gems/switch_access-rails/versions/1.1.6

I even tried bumping from version 1.1.5 to 1.1.6 just to see if that helped.

Installing version 1.1.4 in with bundle install works.

Any tips on where to start looking/debugging bundle install?

Best Answer

And after a whole day of googling I found this status update from Dec 12: http://twitter.com/rubygems_status/status/279019743166476288

bundle install --full-index

Seems to get the index directly from rubygems instead of from a cloudfront cache.

I had a look at the index, and there is quite a diffence in the two indexes, so if you just released a gem or use a newly released gem, you might have to add --full-index in order to get the proper index.