gem install error: CoreFoundation is needed to build the Xcodeproj C extension #80

mattconnolly opened this Issue Aug 6, 2013 · 7 comments


None yet
5 participants

mattconnolly commented Aug 6, 2013

I've tried installing xcodeproj version 0.8.1 and 0.0.9 and I get the same error on installation:

checking for CoreFoundation... no
checking for main() in -lCoreFoundation... no
CoreFoundation is needed to build the Xcodeproj C extension.

I'm using rvm ruby 2.0.0-p247 on Mac OS X 10.8.4 with Xcode 4.6.3 installed.

If I download the source, I see the same error from rake ext:build. Any ideas?


mattconnolly commented Aug 6, 2013

I think this looks like an upstream bug in RVM. I found the following options crept in to the mkmf options:

-L/Users/mpapis/.sm/pkg/active/lib -I/Users/mpapis/.sm/pkg/active/include

I think this is the first RVM that I've used that did a binary distribution of ruby... I'll investigate further.


mattconnolly commented Aug 6, 2013

Perhaps not RVM. I've reinstalled ruby and the Xcode command line tools. It still fails. I've discovered that the "-Z" flag seems to cause the problem from RbConfig::CONFIG["LDFLAGS"]. Removing it allows me to build the gem locally. Adding:

$LDFLAGS.gsub!(/\s-Z\s/,' ')

Before unless have_framework('CoreFoundation') got me going.

The flag could be coming from RVM still...


goonzoid commented Aug 12, 2013

You're not alone, I'm having the same issue (using rvm head). Haven't had time to investigate properly yet though.

ayn commented Aug 16, 2013

I had the same problem, and I reinstalled ruby 2 from source with clang and everything works now:

rvm reinstall ruby-2.0.0-p247 --with-gcc=clang --verify-downloads 1

The verify-downloads part was needed coz rvm couldn't verify checksum of rubygems when I tried to reinstall ruby 2. YMMV


goonzoid commented Aug 16, 2013

Thanks. I had to completely remove xcodeproj and reinstall. Simply doing gem pristine xcodeproj wasn't enough, although it claimed to have rebuilt the native extensions correctly. It's all working now though.

aleks2a commented Aug 16, 2013

Thanks! Helped me too.

@mattconnolly mattconnolly pushed a commit to mattconnolly/Xcodeproj that referenced this issue Sep 2, 2013

Matt Connolly Remove -Z linker flag to avoid missing CoreFoundation compile error
Refer Issue #80

alloy commented Sep 2, 2013

Fixed by #86.

alloy closed this Sep 2, 2013

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