Search code examples
rubyterminalrubygemsbundler

Error installing Bundler


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?


Solution

  • Had the same issue and everything is described here: http://railsapps.github.io/openssl-certificate-verify-failed.html

    tl;dr Recent versions of RVM, the Ruby Version Manager, include a utility to diagnose and resolve errors caused by outdated certificate files. See the article Installing Rails for instructions and advice. The RVM website explains how to install RVM.

    If you’ve installed RVM, try this:

    $ rvm -v
    # rvm 1.19.1 (stable)
    $ rvm osx-ssl-certs status all
    # Certificates for...
    $ rvm osx-ssl-certs update all
    # Updating certificates...
    

    That’s all that is needed to resolve the issue if you are using RVM (you must be using RVM version 1.19.1 or newer).