0
Fetching source index from https://rubygems.org/
Retrying source fetch due to error (2/3): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for rubygems.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Retrying source fetch due to error (3/3): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for ruby gem.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
Could not verify the SSL certificate for rubygems.
There is a chance you are experiencing a man-in-the-middle attack, but most
likely your system doesn't have the CA certificates needed for verification. For
information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without
using SSL, edit your Gemfile sources and change 'https' to 'http'.
         run  bundle exec spring binstub --all

I ran gem update --system, but it did not work. I came down with another error:

ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)

What is going on here and how can I fix it? Thank you

  • Try these steps. – Sirajus Salekin Feb 10 '17 at 3:34
  • Hi Sirajus! Thank you for the help. I used the non-ssl version of rubygems in my gemfile as a temporary fix. I changed the gem sources like so in terminal: gem sources --remove rubygems.org gem sources --add rubygems.org gem update --system and these steps temporarily fixed the problem because when I tried to generate a new rails application, I have the same SSL certificate issue. Why is this happening? How can I permanently fix the problem? Does this have anything to do with the way how I installed ruby? – user5622933 Feb 15 '17 at 23:49
  • Hi @user5622933, wish I could be of more help, but I am also new on ruby on rails, so my knowledge is very limited. I installed ror on my ubuntu following these steps from GoRails without any hassle, you can chek it out if you like. – Sirajus Salekin Feb 16 '17 at 3:22
1

This issue usually occurs with old versions of rubygem. You can try updating it by running

gem update --system --source http://rubygems.org/

and after that

gem update

source.

| improve this answer | |
  • But this step would temporarily fix the problem because when I try to generate an application I am seeing the same SSL certificate issue error. Do I need to install a newer version of ruby? Thank you – user5622933 Feb 21 '17 at 2:01
  • @user5622933, what version are you using currently? and how did you install? – Sirajus Salekin Feb 21 '17 at 3:16
  • I'm using: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]. I used Ruby Version Manager to install ruby. Shall I uninstall ruby and re install it's newer version? – user5622933 Feb 22 '17 at 23:48
  • @user5622933, thats really not a solution, but I am out of ideas too. If its not a hassle or if you're in a hurry you can reinstall. Follow this guide for help. To uninstall rvm follow this guide – Sirajus Salekin Feb 23 '17 at 6:14
  • If uninstalling ruby and reinstalling it won't solve the SSL certificate problem than I don't need to do that right now. I'm still wondering why do I have this problem with SSL certificate every time I create a new rails project. Thank you :) – user5622933 Feb 26 '17 at 21:31
-1

Create a new file .gemrc in your home directory and add this line.

:ssl_verify_mode: 0

Now, it should continue even if it can't verify that the SSL connection is "trusted".

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.