title: gem mongoid : Could not fetch specs from https://rubygems.org/
body: <p>I'm trying for 2 days now to setup Mongodb with Rails 4.
  I've got the following gems in my Gemfile :</p>
  
  <pre><code>source 'https://rubygems.org'
  
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '4.0.0'
  
  gem 'mongoid', github: 'mongoid/mongoid'
  gem 'bson_ext'
  gem 'mongo_mapper'
  
  # Use SCSS for stylesheets
  gem 'sass-rails', '~&gt; 4.0.0'
  
  # Use Uglifier as compressor for JavaScript assets
  gem 'uglifier', '&gt;= 1.3.0'
  # Use CoffeeScript for .js.coffee assets and views
  gem 'coffee-rails', '~&gt; 4.0.0'
  
  gem 'jbuilder', '~&gt; 1.2'
  
  group :doc do
    # bundle exec rake doc:rails generates the API under doc/api.
    gem 'sdoc', require: false
  end
  </code></pre>
  
  <p>When I try <code>bundle install</code> on my osx shell, I have the following lines :</p>
  
  <pre><code>Updating git://github.com/mongoid/mongoid.git
  Fetching source index from https://rubygems.org/
  Could not fetch specs from https://rubygems.org/
  </code></pre>
  
  <p>I've tried with several versions of mongoid gem but nothing makes the <code>rails generate mongoid:config</code> command work.</p>
  
  <p>Any clue ?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is the bundle install --verbose trace</p>
  
  <pre><code>Updating git://github.com/mongoid/mongoid.git
  Fetching from: https://rubygems.org/api/v1/dependencies
  Fetching source index from https://rubygems.org/
  Gem::RemoteFetcher::UnknownHostError: no such name (https://rubygems.org/specs.4.8.gz)
  /Users/xxx/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/remote_fetcher.rb:283:in `rescue in fetch_path'
  /Users/xxx/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/remote_fetcher.rb:258:in `fetch_path'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:454:in `fetch_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:468:in `block in fetch_all_remote_specs'
  /Users/xxx/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/source_list.rb:90:in `block in each'
  /Users/xxx/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/source_list.rb:90:in `each'
  /Users/xxx/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/source_list.rb:90:in `each'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:466:in `fetch_all_remote_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:262:in `fetch_all_remote_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:116:in `specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:228:in `block in remote_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:228:in `each'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:228:in `remote_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:163:in `fetch_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:67:in `specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:192:in `block (2 levels) in index'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `each'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `block in index'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/index.rb:9:in `build'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:185:in `index'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:179:in `resolve'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/bin/bundle:20:in `block in &lt;top (required)&gt;'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/bin/bundle:20:in `&lt;top (required)&gt;'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/bin/bundle:23:in `load'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/bin/bundle:23:in `&lt;main&gt;'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/bin/ruby_executable_hooks:15:in `eval'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
  Could not fetch specs from https://rubygems.org/
  Bundler::HTTPError: Could not fetch specs from https://rubygems.org/
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:268:in `rescue in fetch_all_remote_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:261:in `fetch_all_remote_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:116:in `specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:228:in `block in remote_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:228:in `each'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:228:in `remote_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:163:in `fetch_specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:67:in `specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:192:in `block (2 levels) in index'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `each'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `block in index'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/index.rb:9:in `build'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:185:in `index'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:179:in `resolve'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/bin/bundle:20:in `block in &lt;top (required)&gt;'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/gems/bundler-1.3.5/bin/bundle:20:in `&lt;top (required)&gt;'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/bin/bundle:23:in `load'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/bin/bundle:23:in `&lt;main&gt;'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/bin/ruby_executable_hooks:15:in `eval'
  /Users/xxx/.rvm/gems/ruby-1.9.3-p448@global/bin/ruby_executable_hooks:15:in `&lt;main&gt;' 
  </code></pre>
  
  <p>Running <code>bundle update</code> gives me :</p>
  
  <pre><code>Using mongoid (4.0.0.beta1) from git://github.com/mongoid/mongoid.git (at master) 
  Gem::FilePermissionError: You don't have write permissions for the /Users/xxx/.rvm/gems/ruby-1.9.3-p448/bin directory.
  An error occurred while installing mongoid (4.0.0.beta1), and Bundler cannot continue.
  Make sure that `gem install mongoid -v '4.0.0.beta1'` succeeds before bundling.
  </code></pre>