Skip to content

Instantly share code, notes, and snippets.

@grammaticof
Forked from benhoskings/ruby-2-cert-issue-fix.sh
Created February 26, 2013 17:46
Show Gist options
  • Save grammaticof/5040466 to your computer and use it in GitHub Desktop.
Save grammaticof/5040466 to your computer and use it in GitHub Desktop.
# If you're having cert issues on ruby 2.0.0-p0, the issue is most likely that ruby can't
# find the required intermediate certificates. If you built it via rbenv/ruby-build, then
# the certs are already on your system, just not where ruby expects them to be.
# When ruby-build installs openssl, it installs the CA certs here:
~/.rbenv/versions/2.0.0-p0/openssl/ssl/cacert.pem
# Ruby is expecting them here:
$(ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE')
# Which for me, is this path:
~/.rbenv/versions/2.0.0-p0/openssl/ssl/cert.pem
# So to fix the problem, all I had to do was this:
(cd ~/.rbenv/versions/2.0.0-p0/openssl/ssl && ln -s cacert.pem cert.pem)
# Woohoo!
@grammaticof
Copy link
Author

useful string "ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE'"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment