I am trying to install the Bundler gem on my Mac. With the command:
sudo gem install bundler
I get the following error:
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz)
It clearly seems to be a server issue, but how do I go about solving this? gem update --system
is currently up-to-date. Is there an alternative way to get Bundler?
For those that arent using rvm, but are using homebrew:
This worked for me.
Below way solve my problem:
.gemrc
edit this file and find
:sources: -https://rubygems.org/
change
https
intohttp
After looking at some of the answers to the Stack question @Matt referenced, although the error was different, one of the solutions also helped me for this problem.
In the home directory, create a file called
.gemrc
. Add:ssl_verify_mode: 0
to the file. Bundler then installs without issue.This works for my situation as I'm behind a corporate firewall. However, this obviously opens up a security hole.
I had this same problem using Windows, and removing the security from the Hypertext Transfer Protocol solve it.
Paste in your terminal:
gem sources -r https://rubygems.org -a http://rubygems.org
Hope it will help! ★
I faced the same problem installing bundler on windows 8.1. I solved it and installed bundler and other gems in the following way
My gem version was 2.2.2. Update gem to 2.4.5 with the command:
gem update --system
Install gems:
gem install bundler
gem install rails
Hope that helps.
sudo gem install bundler --no-ri --no-rdoc
.ERROR: Could not find a valid gem 'bundler' (>= 0), here is why: Unable to download data from https://rubygems.org/ - Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/latest_specs.4.8.gz)
gem sources --remove https://rubygems.org/
gem sources --remove http://rubygems.org/
gem sources -l
and the output show:
*** CURRENT SOURCES *** http://rubygems.org/
sudo gem install bundler --no-ri --no-rdoc
again:Fetching: bundler-1.11.2.gem (100%) Successfully installed bundler-1.11.2 1 gem installed
Bingo!!!