07-18-2023, 04:42 PM
I'm using Ruby 1.9.3p0 on Mac OS 10.6.8 (installed using rvm). When I attempt to create a new Rails application using an [application template hosted on GitHub][1], with this (for example):
<pre>
$ rails new myapp -m
</pre>
I get this error message:
<pre>/Users/me/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect': SSL_connect
returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
(OpenSSL::SSL::SSLError)
</pre>
I understand the Ruby language interpreter is using OpenSSL to connect to GitHub to request the application template file. GitHub requires all connections to be made using SSL. The connection failed because OpenSSL was unable to verify the server certificate.
I was able to resolve the issue by downloading a certificates file:
<pre>$ cd /opt/local/etc/openssl
$ sudo curl -O
</pre>
I had no problem using Ruby 1.9.2. Why did I get the "certificate verify failed" problem for Ruby 1.9.3? Is this a Ruby 1.9.3 bug? Is it specific to Mac OS 10.6.8? Is my solution the right way to resolve this?
[1]:
<pre>
$ rails new myapp -m
[To see links please register here]
-T -O</pre>
I get this error message:
<pre>/Users/me/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect': SSL_connect
returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
(OpenSSL::SSL::SSLError)
</pre>
I understand the Ruby language interpreter is using OpenSSL to connect to GitHub to request the application template file. GitHub requires all connections to be made using SSL. The connection failed because OpenSSL was unable to verify the server certificate.
I was able to resolve the issue by downloading a certificates file:
<pre>$ cd /opt/local/etc/openssl
$ sudo curl -O
[To see links please register here]
$ sudo mv cacert.pem cert.pem</pre>
I had no problem using Ruby 1.9.2. Why did I get the "certificate verify failed" problem for Ruby 1.9.3? Is this a Ruby 1.9.3 bug? Is it specific to Mac OS 10.6.8? Is my solution the right way to resolve this?
[1]:
[To see links please register here]