2

I intalled mavericks this morning on my mac, but it seems it has done something with ruby gems... When i type:

sudo gem install cocoapods

It breaks with error:

ERROR:  Error installing cocoapods:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h

I browsed net and found this, some people say that it helps, but before doing it can anyone elaborate some more on this:

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

Will copying this solve a problem, and if it doesn't am I in danger of losing something?

MegaManX
  • 8,766
  • 12
  • 51
  • 83
  • 1
    Looks like this may have been fixed with Xcode 5.0.1 from the MAS. https://gist.github.com/goshakkk/5763489#comment-931445 – Keith Smiley Oct 23 '13 at 15:11
  • It seems you are right, i updated today to 5.0.1, and seems ok. Post as an answer so i can give credit where it is due. – MegaManX Oct 23 '13 at 17:29

2 Answers2

9

As an update since this question is a few months old:

I have XCode 5.0.2 installed on OS X Mavericks and ran into the exact same issue. The issue may have been fixed with XCode 5.0.1, but something broke again...

I'd downloaded/installed XCode command line tools for Mavericks w/o success. Next tried the solution above w/no success.

What finally worked for me was sym link gcc to gcc-4.2 as explained here: command line tools for new 10.9 OSX for ruby gems?

sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2 

After that, cocoapods finally installed properly.

Community
  • 1
  • 1
mc01
  • 3,750
  • 19
  • 24
1

Looks like this may have been fixed with Xcode 5.0.1 from the MAS. https://gist.github.com/goshakkk/5763489#comment-931445

Keith Smiley
  • 61,481
  • 12
  • 97
  • 110