Ruby gem cucumber SSL error and Gem sources
I had the same issue a while back after moving to ruby 2.0.0
Follow the following steps to solve it
1)Visit the url http://curl.haxx.se/ca/cacert.pem save the contents as a .pem file(Do not save it as a text file.Make sure the extension is .pem)
2)Copy the file to any path in your local eg: C:\ruby200\ca_cert.pem (in my case)
3)Now add an Environment variable with Variable SSL_CERT_FILE and value "C:\ruby200\ca_cert.pem"(without quotes)(path is in my case.Replace with appropriate path) (Environment variables can be added by navigating to Computer -> Advanced Settings -> Environment Variables)
4)Close all your command prompts and restart them.Things should work fine now
gem sources -a not working also SSL error is therre
gem 2.5.1 got installed due to MSI installer of ruby 2.3.1p112 on windows 10 x64 so we need to exclusively update gem version by gem install rubygems-update
thereafter update_rubygems. This is available here
SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/
For RVM & OSX users
Make sure you use latest rvm:
rvm get stable
Then you can do two things:
Update certificates:
rvm osx-ssl-certs update all
Update rubygems:
rvm rubygems latest
For non RVM users
Find path for certificate:
cert_file=$(ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE')
Generate certificate:
security find-certificate -a -p /Library/Keychains/System.keychain > "$cert_file"
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> "$cert_file"
The whole code: https://github.com/wayneeseguin/rvm/blob/master/scripts/functions/osx-ssl-certs
For non OSX users
Make sure to update package ca-certificates
. (on old systems it might not be available - do not use an old system which does not receive security updates any more)
Windows note
The Ruby Installer builds for windows are prepared by Luis Lavena and the path to certificates will be showing something like C:/Users/Luis/...
check https://github.com/oneclick/rubyinstaller/issues/249 for more details and this answer https://stackoverflow.com/a/27298259/497756 for fix.
Can't install any RubyGems, invalid argument error when connecting to sources [gem 2.4.8]
There are [known] issues with SSL on rubygems.org, not on your machine. Explicitly set the source to be HTTP, not HTTPS:
gem install rspec --source http://rubygems.org
In your Gemfile
(if any) you probably should set:
source 'http://rubygems.org'
as the very top line.
Related Topics
How to Serialize a Ruby Digest::Sha1 Instance Object
Shading Mask Algorithm for Radiation Calculations
Ruby on Rails - Pagination on Search Result
Can You Have Multiple Versions of a Gem in a Gemfile
Validates Presense VS Null False in Rails Models/Tables
System New Line Separator in Ruby
Nameerror: Undefined - Have Parsing Rules for Local Variables Changed in Ruby 2.1.2
Rewrite Template.Js.Erb into Template.Js.Slim
Why Does "True or True and False" Appear to Be Simultaneously True and False
Rails 5.2 Activestorage Save and Then Read Exif Data
Ruby on Rails - £ Sign Troubles
How to Install Ruby System-Wide Using Rbenv
Rails 3.2 Create a Form That's Used in the Footer of Every Page
How to Interpolate a Variable in a Ruby Regex
Rails 3: Belongs_To, Has_One and Migrations
How to Convert This Ruby String into an Array
Rails Syntax Error: Unexpected Keyword_Ensure, Expecting Keyword_End