Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting frequent Gem RemoteFetcher::FetchError. Any workarounds?

I've been getting this error frequently every day for the last few days...

$ gem install rails -v 3.2.1
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    bad response Forbidden 403 (http://production.cf.rubygems.org/gems/rdoc-3.12.gem)

My understanding based on a previous question is that this is due to a problem with the remote repository and the solution is to just wait a little while and try again. Indeed, sometimes when I wait a few hours or overnight the install command works.

However, I'm hoping for a more reliable experience.

I thought of downloading files such as rails-3.2.1.gem and then running...

$ gem install --local ~/Desktop/rails-3.2.1.gem

But that gives me...

$ gem install --local ~/Desktop/rails-3.2.1.gem 
ERROR:  While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: rails requires railties (= 3.2.1)

I could try downloading railties. Maybe I will. But I sense a plunge down a rabbit hole there of searching out dependency after dependency all day long.

Any alternate efficient ways to install gems? Is there something I could do through my repository specification that would allow gem installation to be more reliable?


$ gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.15
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.2.0]
  - INSTALLATION DIRECTORY: /Users/ethan/.rvm/gems/ruby-1.9.2-p290@rails_3_for_mtc
  - RUBY EXECUTABLE: /Users/ethan/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/ethan/.rvm/gems/ruby-1.9.2-p290@rails_3_for_mtc/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/ethan/.rvm/gems/ruby-1.9.2-p290@rails_3_for_mtc
     - /Users/ethan/.rvm/gems/ruby-1.9.2-p290@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://rubygems.org"]
     - "gem" => "--no-rdoc --no-ri"
     - "install" => "--no-rdoc --no-ri"
     - "update" => "--no-rdoc --no-ri"
  - REMOTE SOURCES:
     - http://rubygems.org
like image 448
Ethan Avatar asked Feb 11 '12 02:02

Ethan


1 Answers

Make sure your rvm ssl certificates are up to date.

Check their status

$ rvm osx-ssl-certs status all

Update them!

$ rvm osx-ssl-certs update all
like image 70
Mike Rapadas Avatar answered Oct 06 '22 03:10

Mike Rapadas