Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
mattconnolly opened this Issue · 7 comments

5 participants

@mattconnolly

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

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

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

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

@ayn

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

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

Thanks! Helped me too.

@mattconnolly mattconnolly referenced this issue from a commit in mattconnolly/Xcodeproj
Matt Connolly Remove -Z linker flag to avoid missing CoreFoundation compile error
Refer Issue #80
2023ec1
@alloy
Owner

Fixed by #86.

@alloy alloy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.