Benamir
Benamir

Reputation: 1117

ruby-1.9.3-p125 ssl error

I just installed ruby-1.9.3-p125 using RVM.

I can create a basic app

rails new my app. 

but when I try building a new app using the rails starter app here: https://github.com/RailsApps/rails3-bootstrap-devise-cancan

by running

rails new rails3-bootstrap-devise-cancan -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb -T

it breaks down and gives me the following error:

/Users/macuser/.rvm/rubies/ruby-1.9.3-p125/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)

It may be worth noting that this worked when using ruby-1.9.2-p290

does any one know how I can fix this?

I'm running osx lion 10.7.4


openssl version OpenSSL 1.0.0f 4 Jan 2012

Upvotes: 1

Views: 351

Answers (3)

tmandry
tmandry

Reputation: 1375

For OSX with Homebrew:

brew install curl-ca-bundle
export SSL_CERT_FILE=/usr/local/opt/curl-ca-bundle/share/ca-bundle.crt

Add the last line to your .bashrc.

Upvotes: 1

Benamir
Benamir

Reputation: 1117

I'm running osx lion 10.7.4

my openssl version was OpenSSL 1.0.0f and i needed to update to 1.0.1

I did this by following this guide:

http://railsapps.github.com/openssl-certificate-verify-failed.html

This was the solution that worked for me:

curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz.asc
curl -L -O http://www.openssl.org/source/openssl-1.0.1b.tar.gz
gpg --verify openssl-1.0.1b.tar.gz.asc
tar xvzf openssl-1.0.1b.tar.gz
cd openssl-1.0.1b
perl ./Configure shared zlib --prefix=/opt/local darwin64-x86_64-cc
make
make test
sudo make install

Upvotes: 0

Brad Werth
Brad Werth

Reputation: 17647

I suspect that this is because of a bug in your version of rubygems.

You can either run

gem update --system

Or, remove the s from your sources in your gemfile, like so:

source 'http://rubygems.org'

Upvotes: 1

Related Questions