CocoaPods/CocoaPods — Issue #140: unable to install cocoapods with xcode 4.3
Author: petejkim
Created: 2012-02-25 07:52:29+00:00
State: open

```
$ macgem install cocoapods
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.

/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/bin/macruby extconf.rb
checking for -std=c99 option to compiler... /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/1.9.2/mkmf.rb:365:in `try_do': The complier failed to generate an executable file.
You have to install development tools first.
(RuntimeError)
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/1.9.2/mkmf.rb:446:in `try_compile'
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/xcodeproj-0.1.0/ext/xcodeproj/extconf.rb:24:in `block'
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/1.9.2/mkmf.rb:693:in `block'
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/1.9.2/mkmf.rb:280:in `block'
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/1.9.2/mkmf.rb:254:in `open'
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/1.9.2/mkmf.rb:280:in `block'
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/1.9.2/mkmf.rb:254:in `open'
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/1.9.2/mkmf.rb:276:in `postpone'
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/1.9.2/mkmf.rb:692:in `checking_for'
from /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/xcodeproj-0.1.0/ext/xcodeproj/extconf.rb:23:in `

'

Gem files will remain installed in /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/xcodeproj-0.1.0 for inspection.
Results logged to /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/xcodeproj-0.1.0/ext/xcodeproj/gem_make.out
```

I do have xcode cli tools installed.

`cat mkmf.log` reveals the following:

```
"/usr/bin/gcc-4.2 -o conftest -I/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/include/ruby-1.9.2/universal-darwin10.0 -I/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/include/ruby-1.9.2/ruby/backward -I/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/include/ruby-1.9.2 -I. -arch x86_64 -fexceptions -fno-common -pipe -O3 -g -Wall conftest.c -L. -L/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib -arch x86_64 -arch x86_64 -lmacruby "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
```

So I tried all of the following:

`ln -s /usr/bin/gcc /usr/bin/gcc-4.2`
`ln -s /usr/bin/clang /usr/bin/gcc-4.2`
`brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/apple-gcc42.rb; ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2`

but it still fails.

```
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.

/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/bin/macruby extconf.rb
checking for -std=c99 option to compiler... yes
checking for CoreFoundation... no
checking for main() in -lCoreFoundation... no
CoreFoundation is needed to build the Xcodeproj C extension.

Gem files will remain installed in /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/xcodeproj-0.1.0 for inspection.
Results logged to /Library/Frameworks/MacRuby.framework/Versions/0.11/usr/lib/ruby/Gems/1.9.2/gems/xcodeproj-0.1.0/ext/xcodeproj/gem_make.out
```