2012/04/25

XCode4.3環境でCocoaPodsをインストール

CocoaPods ではじめる Objective-C ライブラリ管理を参考にCocoaPodsをインストールしようとしたら、最初からハマりました...

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

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


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/xcodeproj-0.1.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/xcodeproj-0.1.0/ext/xcodeproj/gem_make.out

最初はmacrubyをインストールしてmacjemでも試したのですが、同じようなエラーでした。調べてみると、まずXCode4.3環境ではmacrubyは必要ないようです。さらに、XCode Command Line Toolを追加でインストールする必要があります。さっそくインストールして再度トライ!

sudo gem install cocoapods
Password:
Building native extensions.  This could take a while...
[!] If this is your first time install of CocoaPods, or if you are upgrading, first run: $ pod setup
Successfully installed xcodeproj-0.1.0
Successfully installed cocoapods-0.5.1
2 gems installed
Installing ri documentation for xcodeproj-0.1.0...

No definition for generate_uuid

No definition for read_plist

No definition for write_plist
Installing ri documentation for cocoapods-0.5.1...
Installing RDoc documentation for xcodeproj-0.1.0...

No definition for generate_uuid

No definition for read_plist

No definition for write_plist
Installing RDoc documentation for cocoapods-0.5.1...

今度は無事にインストールできました。XCode4.3環境の人は、「XCode上でCommand Line Tools」をインストールしてから「sudo gem install cocoapods」するだけなのでとってもお手軽です。

参考リンク

0 件のコメント:

コメントを投稿