Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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

This comment has been minimized.

Show comment Hide comment
@nitsky

nitsky Jun 12, 2013

This worked for me, thanks so much!

nitsky commented Jun 12, 2013

This worked for me, thanks so much!

@lprhodes

This comment has been minimized.

Show comment Hide comment
@lprhodes

lprhodes Jun 15, 2013

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

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

This comment has been minimized.

Show comment Hide comment
@mralexgray

mralexgray Jun 16, 2013

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

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

@tomwildcat9

This comment has been minimized.

Show comment Hide comment
@tomwildcat9

tomwildcat9 Jun 16, 2013

Worked for me too! Thanks!!!!!

Worked for me too! Thanks!!!!!

@cameronehrlich

This comment has been minimized.

Show comment Hide comment
@cameronehrlich

cameronehrlich Jun 16, 2013

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

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

@ghost

This comment has been minimized.

Show comment Hide comment
@ghost

ghost Jun 19, 2013

Outstanding! Thanks a million.

ghost commented Jun 19, 2013

Outstanding! Thanks a million.

@MoOx

This comment has been minimized.

Show comment Hide comment
@MoOx

MoOx Jun 28, 2013

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

MoOx commented Jun 28, 2013

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

This comment has been minimized.

Show comment Hide comment
@phatblat

phatblat Jul 26, 2013

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

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

This comment has been minimized.

Show comment Hide comment
@edgartl

edgartl Aug 28, 2013

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

edgartl commented Aug 28, 2013

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

@travisjeffery

This comment has been minimized.

Show comment Hide comment
@travisjeffery

travisjeffery Sep 5, 2013

Is this working for people using Rbenv?

Is this working for people using Rbenv?

@zhigang1992

This comment has been minimized.

Show comment Hide comment
@zhigang1992

zhigang1992 Sep 15, 2013

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

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

@owensd

This comment has been minimized.

Show comment Hide comment
@owensd

owensd Sep 19, 2013

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

owensd commented Sep 19, 2013

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

@danmartyn

This comment has been minimized.

Show comment Hide comment
@danmartyn

danmartyn Sep 21, 2013

@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...

@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

This comment has been minimized.

Show comment Hide comment
@jasarien

jasarien Sep 25, 2013

@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.

@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

This comment has been minimized.

Show comment Hide comment
@andrewtheis

andrewtheis Oct 1, 2013

Anyway to run this without having the Xcode 5 DP?

Anyway to run this without having the Xcode 5 DP?

@tulushev

This comment has been minimized.

Show comment Hide comment
@tulushev

tulushev Oct 14, 2013

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

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

@jurre

This comment has been minimized.

Show comment Hide comment
@jurre

jurre Oct 17, 2013

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

jurre commented Oct 17, 2013

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

@rivera-ernesto

This comment has been minimized.

Show comment Hide comment
@rivera-ernesto

rivera-ernesto Oct 18, 2013

Seems like Xcode 5.0.1 GM fixes this problem.

Seems like Xcode 5.0.1 GM fixes this problem.

@DenHeadless

This comment has been minimized.

Show comment Hide comment
@DenHeadless

DenHeadless Oct 23, 2013

XCode 5.0.1 release definitely is fixing this issue.

XCode 5.0.1 release definitely is fixing this issue.

@siancu

This comment has been minimized.

Show comment Hide comment
@siancu

siancu Oct 23, 2013

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

siancu commented Oct 23, 2013

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

@giladno

This comment has been minimized.

Show comment Hide comment
@giladno

giladno Dec 8, 2013

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

giladno commented Dec 8, 2013

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

@jnozsc

This comment has been minimized.

Show comment Hide comment
@jnozsc

jnozsc Jun 18, 2014

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.

jnozsc commented Jun 18, 2014

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