OS: Mac Catalina 15.5.5
Ruby: 2.7.1
Rails: 6.0.2.2
I was trying to uninstall the MySQL Gem and re-install it:
gem uninstall mysql2
Response:
Successfully uninstalled mysql2-0.5.3
brew upgrade openssl
Response:
openssl 1.1.1g already installed
gem install mysql2 -v 0.5.3 -- --with-opt-dir="$(brew --prefix openssl)"
Response:
ERROR: Could not find a valid gem 'mysql2' (= 0.5.3), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello (https://rubygems.org/specs.4.8.gz)
This is not just for the MySQL gem. I tried creating a new Rails app, and when it tries to do the bundle, I get the same error about nor being able to access rubygems.org
Any ideas?
Solution:
Turns out it's a problem with the Kaspersky Internet Protection product. Out of the blue, it updated and decided to start blocking https connections. I've had so many problems with this product and regret having it installed, but don't think I can be without malware protection.
Related
Ruby version is 2.5.1 and gem version is 2.7.7 both updated today. OpenSSL is 1.0.2 also updated today.
When i run
gem install rails -v 5.2.0
I get the following error:
ERROR: Could not find a valid gem 'rails' (= 5.2.0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/specs.4.8.gz)
I have checked all GitHub issues and none of them had a solution. I added certificates to keychain and to the openSSL folder and nothing has seemed to work. Any ideas?
I have also checked my router and computer firewalls
Have a look at this question and try:
$ rvm -v
# rvm 1.19.1 (stable)
$ rvm osx-ssl-certs status all
# Certificates for...
$ rvm osx-ssl-certs update all
# Updating certificates...
I am trying to install rails in windows 10. When I attempt to install rails in my gemset, I get the following issue:
C:\>gem install rails
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://api.rubygems.org/latest_specs.4.8.gz)
Currently using ruby version.
C:\>ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]
Gem Vesrion.
C:\>gem --version
2.2.3
how can I fix these issue help me out from this.
now I got solution for this issue, using this link http://guides.rubygems.org/ssl-certificate-update/#manual-solution-to-ssl-issue
we need to add GlobalSignRootCA.pem this certificate in ssl_certs folder insted of AddTrustExternalCARoot-2048.pem
go through that above link.
Your problem is most likely outdated SSL certificates included in installation.
This might help: https://gist.github.com/luislavena/f064211759ee0f806c88
For the first time, I am trying ruby-2.3.0. I installed it from rvm. After installation, I try to install Rails:
$ rvm-prompt
ruby-2.3.0#mygemset
$ rvm osx-ssl-certs update all
Updating certificates for /etc/openssl/cert.pem: Updating certificates in '/etc/openssl/cert.pem'.
Updated.
Updating certificates for /usr/local/etc/openssl/cert.pem: Already up to date.
$ rvm rubygems latest
Installed rubygems 2.5.1 is newer than 2.4.8 provided with installed ruby, skipping installation, use --force to force installation.
$ gem install rails
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=error: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
Why am I receiving the error certificate verify failed? When I navigate to the link https://api.rubygems.org/specs.4.8.gz on the browser, it downloads without problem.
Have a look here https://gist.github.com/luislavena/f064211759ee0f806c88 (see also Issue #1050 on the rubygems gem repo itself: https://github.com/rubygems/rubygems/issues/1050 if you want some great bedtime reading )
The gist (no pun intended) is that RubyGems had to update their SSL Certificate in a manner which was not deployable via rubygems itself.
You will need to do a 1 time manual installation / update of rubygems
I'm trying to install rails on a new computer and am running to the following command issue:
gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from http://gems.rubyforge.org/ -SSL_connect reuterned=1 error=0 state=SSLv2/v3 read server hello A: Unknown protocol (http://gems.rubyforge.org/latest_specs.4.8.gz)
Make sure you are using the latest rvm than you can update your certificates and rubygems. Or just use the non-ssl source.
I am unable to install gems, what changes do I need to do in my settings of browser to get downloaded? I am using Windows 7
C:\Users\MAX JOHN>gem install rails --no-ri --no-rdoc
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol (https://ruby
gems.org/latest_specs.4.8.gz)
C:\Users\MAX JOHN>gem install mysql
ERROR: Could not find a valid gem 'mysql' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol (https://ruby
gems.org/latest_specs.4.8.gz)
setting the source to http instead of https is not recommended as it creates security issues.
Try pinging https://rubygems.org, this will tell you if the problem is with your connection issues or not.
Assuming you're using Rails 3, have a look at this post on how to set up WEBrick to use SSL:
http://www.nearinfinity.com/blogs/chris_rohr/configuring_webrick_to_use_ssl.html
Do you have more than one version of Ruby installed? I accidentally upgraded without removing a prior installation, and removing that fixed the same issue for me.
I had similar problem, and solved it by:
Downloading the gem via web browser from https://rubygems.org/
Install it locally by cd ing into the dir where the gem was downloaded and ran:
gem install --local .gem