Trying to make my Ruby environment happy under OS X 10.8 Mountain Lion
A few notes. I had:
- installed XCode 2.4 Preview as well as its command line tools (which are found separately in Preferences -> Downloads)
- updated rvm (
rvm get latest
)
and my issue was:
- system ruby installed every gem with native extensions I threw at it
- under rvm, MRI 1.8.7 & 1.9.2 both failed to install nokogiri & gherkin
- rvm failed to upgrade MRI 1.8.7
Update: Just tried this after reading this failure, and now both gems install fine under rvm's 1.8.7 (nokogiri still fails under rvm 1.9.2). Presumably, Apple upgraded /usr/bin/gcc, obviating the separate binary with the version name:
$ sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
As a result, I opened this issue on rvm.
Update 2: Earlier, while fighting this issue I had used brew link libxml2 libxslt
; when I went back and ran brew unlink libxml2 libxslt
, then nokogiri finally installed using rvm 1.9.2
@mfahy I commented out the line where I was setting DYLD_LIBRARY_PATH with the mysql path, but now I get the original error that caused me to put it there.
require': dlopen(/Users/brandon/.rvm/gems/ruby-1.9.3-p194@cadio/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Any ideas on how to fix it without setting the library path?
Edit: I found the fix
For anyone looking for the same answer, it was a super simple fix
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib