Skip to content

Instantly share code, notes, and snippets.

@searls
Created February 18, 2012 18:18
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save searls/1860511 to your computer and use it in GitHub Desktop.
Save searls/1860511 to your computer and use it in GitHub Desktop.
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.
@mfahy
Copy link

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
Copy link

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)

@cowboyrushforth
Copy link

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

@joshuapinter
Copy link

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