Permalink
Browse files

Download root certificates when installing Ruby.

This fixes errors such as:

    SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B:
    certificate verify failed (Faraday::Error::ConnectionFailed)
  • Loading branch information...
1 parent 59a834c commit fefb1d986fa01e9c190f97c907b59006835aefdf @jasoncodes committed Nov 12, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 aliases/rbenv.sh
View
@@ -18,6 +18,13 @@ ruby-install() {
echo 'eval "$(rbenv init - --no-rehash)"' >> $RCFILE
fi
eval "$(rbenv init - --no-rehash)" # load rbenv in the current shell
+ export SSL_CERT_FILE="/usr/local/etc/openssl/certs/cert.pem"
+ if ! grep -q SSL_CERT_FILE $RCFILE; then
+ echo "export SSL_CERT_FILE=\"$SSL_CERT_FILE\"" >> $RCFILE
+ fi
+ if ! [[ -e "$SSL_CERT_FILE" ]]; then
+ curl -o "$SSL_CERT_FILE" http://curl.haxx.se/ca/cacert.pem
+ fi
export CONFIGURE_OPTS="--disable-install-doc --with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)"
rbenv install $VERSION
export RBENV_VERSION="$VERSION"

0 comments on commit fefb1d9

Please sign in to comment.