24

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?

ProGM
  • 6,949
  • 4
  • 33
  • 52
leifcr
  • 1,458
  • 11
  • 15

2 Answers2

49

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.

leifcr
  • 1,458
  • 11
  • 15
  • just happened to me with aws-sdk 3.0.1 gem – user2153517 Oct 31 '17 at 10:02
  • I am also having a similar issue. I tried your solution and bumped into the following issue: `/usr/bin/env: ruby_executable_hooks: No such file or directory` – Curious Developer Nov 28 '18 at 06:23
  • @CuriousDeveloper This looks more like a missing setup for ruby, rbenv or rvm. Try reinstalling rbenv, ruby and/or rvm, depending on your setup, as it's missing an executable. – leifcr Dec 03 '18 at 09:41
  • @leifcr, thanks for your suggestion, my issue is resolved now. I am stuck on a different issue maybe you can help me resolve it here is the post link: https://serverfault.com/questions/941802/unable-to-push-recent-changes-to-old-ruby-website-on-heroku – Curious Developer Dec 04 '18 at 11:02
2

Do you have rubygems listed as a remote source?

Your Gemfile should have source :rubygems at the top of the file, and $ gem sources should return at a minimum:

*** CURRENT SOURCES ***

http://rubygems.org/

If it's not listed, you can add it with $ gem sources -a http://rubygems.org

Colin R
  • 17,711
  • 2
  • 20
  • 28
  • Sorry. Forgot to copy that from my Gemfile, as I trimmed it down to a minimum. I found the answer however. Seems like cloudfront metadata caching issue on the rubygems index, as the gem was released today. – leifcr Dec 19 '12 at 21:04