Install rails 4.2 problems on mac yosemite

I had big problems today to install rails 4.2 on my mac wiht MacOS 10.10. Yosemite.

There were this two mayor problems. The first was related to wrong SSL certificates and the other one to nokogiri.

wrong SSL certificates
If you have this error then there is something wrong with your SSL certificates
openssl::ssl::sslerror: ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed

After a long research and try and error i found a pretty easy solution
here.

The following text is copied from there:

Well, let’s just fix the problem already! The goal here is to provide OpenSSL with a CA bundle that contains all of the trusted Certificate Authorities. Where does one find such a bundle?

The CAs can be exported from Keychain, or they could also be downloaded here. I used the cacert.pem file. Place this file in a directory such as /usr/local/etc/openssl/certs/. Now, in order to let OpenSSL know about these certs, add an environment variable, SSL_CERT_FILE.


export SSL_CERT_FILE=/usr/local/etc/openssl/certs/cacert.pem

I would suggest adding this to the ~/.bash_profile so it is always configured.
That should be all there is too it. Refresh the terminal session if necessary and enjoy!

nokogiri install fails
The second problem was that nokogiri can’t be installed because of a error about Undeclared Identifier LZMA_OK


xmlIO.c:1450:52: error: use of undeclared identifier 'LZMA_OK'
ret = (__libxml2_xzclose((xzFile) context) == LZMA_OK ) ? 0 : -1;
^
1 error generated.

Solution:

http://www.nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x


brew install libxml2
gem install nokogiri -- --use-system-libraries --with-xml2-include=$(brew --prefix libxml2)/include/libxml2

Comments are closed.