Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Stack traces I get when I attempt to install native Ruby extensions on OS X 10.8 Mountain Lion Developer Preview

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

$ rvm use system
Now using system ruby.
$ sudo gem install gherkin
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
Building native extensions. This could take a while...
Successfully installed gherkin-2.8.0
1 gem installed
$ rvm use system
Now using system ruby.
$ gem install nokogiri
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
Password:
Building native extensions. This could take a while...
Successfully installed nokogiri-1.5.0
1 gem installed
$ rvm use ruby-1.8.7-p352
Using /Users/justin/.rvm/gems/ruby-1.8.7-p352
$ gem install gherkin
Building native extensions. This could take a while...
Successfully installed gherkin-2.8.0
1 gem installed
$ rvm use ruby-1.8.7-p352
Using /Users/justin/.rvm/gems/ruby-1.8.7-p352
$ gem install nokogiri
Building native extensions. This could take a while...
Successfully installed nokogiri-1.5.0
1 gem installed
$ rvm use 1.9.2
Using /Users/justin/.rvm/gems/ruby-1.9.2-p290
$ gem install gherkin
Building native extensions. This could take a while...
Successfully installed gherkin-2.8.0
1 gem installed
$ rvm use 1.9.2
Using /Users/justin/.rvm/gems/ruby-1.9.2-p290
$ gem install nokogiri
Building native extensions. This could take a while...
Successfully installed nokogiri-1.5.0
1 gem installed
$ rvm upgrade ruby-1.8.7-p352 1.8.7
Are you sure you wish to upgrade from ruby-1.8.7-p352 to ruby-1.8.7-p357? (Y/n):
Installing new ruby ruby-1.8.7-p357
The autodetected CC(/usr/bin/gcc-4.2) is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`, and set CC=/path/to/gcc .
Unable to install ruby ruby-1.8.7-p357. Please install it manually to continue.

willmot commented Apr 19, 2012

I see you getting the following error

dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid

I am too, any idea what it is or how to fix?

Hey, I am too geting this error while running Rails server with Phusion Passenger. Have anyone fixed it ?

I am also getting this on the Mountain Lion GM

Owner

searls commented Jul 10, 2012

Because people are winding up here via Google, this is what I did yesterday to make Mountain Lion happy.

  1. In the meantime since first gisting this, I switched from rvm to rbenv & ruby-loader.
  2. After the Mountain Lion install nuked my CLI tools, I installed osx-gcc-installer, then I installed gcc-4.2 from homebrew/dupes.
  3. Next I installed the newest Xcode 4.4 preview, along with its command line tools

Finally, nokogiri & imagemagick would build fine.

I actually did not have problems rebuilding imagemagick and nokogiri once I managed to get homebrew to install apple-gcc42. I just get the 'dyld: DYLD_ environment variables being ignored' pretty much every time sudo is used.

willmot commented Jul 10, 2012

I tracked down the DYLD_ environment variables issue to an install of http://asepsis.binaryage.com/. Uninstalling it fixed the issue.

spaquet commented Jul 16, 2012

Me too. I have the 'dyld: DYLD_ environment variables being ignored' message.
After checking I found out that all executable in /usr/bin and /usr/local/bin which rws are sending the same message. I tried to clean (purge) dyld cache but nothing changed.

mfahy commented Jul 25, 2012

*dyld: DYLD environment variables being ignored... *_ is due to the export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/ you probably have in your bash profile from way back when you installed MySQL (or some other package that requires it). While the condition isn't new to 10.8, the warning IS. While it can be ignored for now, it IS extremely annoying, as it appears (and is logged) every time you try to access certain files (usually in /usr/bin and /usr/local/bin).

A bug report has been filed with Apple, and an OpenRadar report can be seen here: http://openradar.appspot.com/11894054

spaquet commented Jul 25, 2012

spaquet commented Jul 26, 2012

@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

mfahy commented Jul 26, 2012

Sorry, I wasn't proposing removing the line, but rather just intended to explain what was causing the error. @brandoncordell's soft-link solution above works like a charm, though. Thanks, b

bf4 commented Jul 30, 2012

The 'fix' for me was to open /Applications/Xcode.app , go to Downloads, and install the command line tools. (Mountain Lion upgraded from lion on a new retina macbook using xcode 4.4)

@myobie has a very helpful document here: https://gist.github.com/1860902

I also had to remove RVM and then re-install it.

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