Certificate issue while trying to install MySQL gem - ruby-on-rails

I am getting the below error while trying to install MySQL gem.
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
What does it mean? How can I fix this?

I hope your have rvm. I updated the certificates. first
rvm get stable
then update the certificates
rvm osx-ssl-certs update all
or Alternatively you can also do
rvm rubygems latest
there are further here if this did not helped.

Related

ruby install gems - SSL connect returned certificate verify failed

I am working on a rails project. I have been working with rails for a while, and use an old MacBook Pro (2012) that has seen ruby/rails development since 2014. In that time, I have both RVM, RBENV, rails versions from 3.2 to 5.1.0, ruby versions from 2.0.0 to 2.2.3 on my machine.
Recently, I have been able to get around the error
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
with installing gems via http and using source 'http://rubygems.org' in my gemfiles.
However, I would like to finally get rid of this issue. I have taken steps to improve this issue doing the following:
following this guide https://gist.github.com/luislavena/f064211759ee0f806c88
which lead to this link https://guides.rubygems.org/ssl-certificate-update/#installing-using-update-packages
which lead to this link https://bundler.io/v1.16/guides/rubygems_tls_ssl_troubleshooting_guide.html#troubleshooting-certificate-errors
The steps I have currently taken were to do the following:
brew update
brew install openssl-osx-ca
brew tap raggi/ale
brew upgrade openssl
However, the result of running gem update --system returned the same error
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
The #3 solution, suggested using rvm implode, forcing brew uninstall openssl --force and starting over. I am very hesitant to do this, because I use rails in my day job and I don't want to show up (i use my machine) with a machine that cannot even turn on a rails server.
Has anyone had to perform something similar? Any actionable steps I could take to fix this SSL issue for once?
Try this manual install instruction https://github.com/rubygems/rubygems/blob/master/UPGRADING.rdoc#manual-install
OR
Download latest rubygem package https://rubygems.org/gems/rubygems-update-2.7.7.gem
Then install it
gem install rubygems-update-2.7.7.gem
This worked for me and for my colleagues.

Unable to install gems due to certificate error

When trying to install gems this error appears
ERROR: Could not find a valid gem 'carrierwave' (>= 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://api.rubygems.org/specs.4.8.gz)
Can't find the reason why
Try...
Download the cacert.pem: https://curl.haxx.se/ca/cacert.pem
Copy the file to the certs directory(ssl_certs) of you ruby installation. Try to find it with windows search

Failed to Install gem Install rails ERROR Could not find a valid gem 'rails'

gem install rails -v 3.2.14
ERROR: Could not find a valid gem 'rails' (=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/specs.4.8.gz)
Maybe you want to try install ruby with rbenv very easy to use and update:http://octopress.org/docs/setup/rbenv/
I believe your machine is running on secure VPN. In my case I experienced same error whenever I try to install any gem while I am connected to secure VPN. Try to disconnect from VPN and try to install the rails gem again.
Hope it helps!!

Error when creating new project

I am attempting my first Ruby on Rails project and when I ran my rails new (projectname) command, I got the following error in command prompt.
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0
state=SSLv3 read server certificate B: certificate failed
(https://rubygems.org/gems/rake-10.4.2.gem)
An error occurred while installing rake (10.4.2), and Bunderler cannot
continue. Make sure that gem install 'gem install rake -v 10.4.2
succeeds' before bundling`
If I'm not mistaken, it looks like it cannot download the Ruby gem for "rake" because the SSL certificate at the URL is not trusted. Is there a way to install without SSL or to make the SSL cert a trusted certificate?
If I'm incorrect in my assumption about the error, can someone point me in the right direction to fix this please? Any help would be greatly appreciated.

Why can't I install any gems on my Mac?

I tried doing gem install for just about any gem and I have been getting errors. I think I need to reset and or update something on my computer but not sure what.
Here is some of the command line code errors:
ERROR: Could not find a valid gem 'multi_json' (>= 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)
ERROR: Could not find a valid gem 'cowsay' (>= 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)
sudo gem install rubygems-update
Password:
ERROR: Could not find a valid gem 'rubygems-update' (>= 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)
Does anyone know what I need to do to fix this? I got a new computer and was wondering if I need to set up the user differently or something?
I had the same problem and this solution from above user worked for me.
rvm osx-ssl-certs update all
There seems to be this common issue lately. If you're on a Mac, try doing this if you installed via RVM:
rvm osx-ssl-certs update all
Alternatively you can add the insecure ruby source with the following command:
sudo gem sources -a http://rubygems.org
For those that arent using rvm, but are using homebrew:
brew tap raggi/ale
brew install openssl-osx-ca
This worked for me.

Resources