Skip to content

Instantly share code, notes, and snippets.

@goshacmd
Created June 12, 2013 07:41
Show Gist options
  • Select an option

  • Save goshacmd/5763489 to your computer and use it in GitHub Desktop.

Select an option

Save goshacmd/5763489 to your computer and use it in GitHub Desktop.
OS X [REDACTED] Ruby 2.0 headers fix.
sys_rb_usr=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sdk_rb_usr=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sudo cp -r $sdk_rb_usr/include $sys_rb_usr/include
@nitsky

nitsky commented Jun 12, 2013

Copy link
Copy Markdown

This worked for me, thanks so much!

@lprhodes

Copy link
Copy Markdown

I had to change to -print-path:

sys_rb_usr=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sdk_rb_usr=xcode-select -print-path/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sudo cp -r $sdk_rb_usr/include $sys_rb_usr/include

@mralexgray

Copy link
Copy Markdown

Loves it! Smooches 9000! Fix for ill-befitting Ruby shenanigans with Cocoapods on 10.9 Mavericks.

@AirZona

AirZona commented Jun 16, 2013

Copy link
Copy Markdown

Worked for me too! Thanks!!!!!

@cameronehrlich

Copy link
Copy Markdown

I've got RVM, do you think this will still work for me?

ghost commented Jun 19, 2013

Copy link
Copy Markdown

Outstanding! Thanks a million.

@MoOx

MoOx commented Jun 28, 2013

Copy link
Copy Markdown

Since I've updated to Command Line Tools 5.0.0 with Mavericks DP2, I remove Platforms/MacOSX.platform/Developer/ because I've no such thing here.

sys_rb_usr=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sdk_rb_usr=`xcode-select -p`/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sudo cp -r $sdk_rb_usr/include $sys_rb_usr/include

@phatblat

Copy link
Copy Markdown

Excellent, thank you!

One note for others, this script fails when you have Xcode 4.6.x set as your default for command-line builds. Run the command below beforehand, adapting for the latest developer preview version you have installed as appropriate:

xcode-select --switch /Applications/Xcode5-DP3.app/Contents/Developer

@edgartl

edgartl commented Aug 28, 2013

Copy link
Copy Markdown

Phatblat - your entry was just what I needed..after being stuck for more than a day - Thanks much!

@travisjeffery

Copy link
Copy Markdown

Is this working for people using Rbenv?

@zhigang1992

Copy link
Copy Markdown

Xcode5 GM doesn't ship with 10.9 SDK, any ideas?

@owensd

owensd commented Sep 19, 2013

Copy link
Copy Markdown

@zhigang1992, Yeah, download Xcode 5 DP 6 from the Mavericks dev center and use the SDK out of that Xcode.app bundle.

@danmartyn

Copy link
Copy Markdown

@owensd, for those of us who don't use the Terminal much (like me) how would we go about doing that? I'm currently running DP 8 of [Redacted] and have Xcode 5 from the App Store and having issues getting cocoa pods to install...

@jasarien

Copy link
Copy Markdown

@danmartyn simply download the Xcode 5 preview from the Mavericks dev centre, once its downloaded, open the disk image, and right click on the Xcode icon and choose "show package contents", from there navigate to Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/and copy the 10.9 sdk - then do the same with your app store downloaded Xcode and paste the 10.9 sdk into the MacOSX.platforms' SDKs folder. Done.

@andrewtheis

Copy link
Copy Markdown

Anyway to run this without having the Xcode 5 DP?

@tulushev

Copy link
Copy Markdown

There is Xcode 5.0.1 GM (with 10.9 sdk) seed in iOS Dev Center now.

@jurre

jurre commented Oct 17, 2013

Copy link
Copy Markdown

Had to reinstall ruby (with rbenv) to get things working again (installed the xcode GM before that)

@rivera-ernesto

Copy link
Copy Markdown

Seems like Xcode 5.0.1 GM fixes this problem.

@DenTelezhkin

Copy link
Copy Markdown

XCode 5.0.1 release definitely is fixing this issue.

@siancu

siancu commented Oct 23, 2013

Copy link
Copy Markdown

Thanks, the workaround worked :-). Even with 5.0.1 installed from the App Store it didn't work.

@giladno

giladno commented Dec 8, 2013

Copy link
Copy Markdown

I can confirm that upgrading to Xcode 5.0.2 solved my problem as well.

@jnozsc

jnozsc commented Jun 18, 2014

Copy link
Copy Markdown

Sorry for a little off topic, does anyone meet the following issue with Yosemite and Xcode 6 beta

/Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in `synchronize': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)

    ERROR: Failed to build gem native extension.

    deadlock; recursive locking

It seems Apple makes another bug with Ruby in Yosemite

Thanks.

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