前陣子在更新cocoapods (gem update cocoapods)時發生了些error,如下:

/Users/hothero/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb checking for -std=c99 option to compiler... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

一些解決步驟如下:

  • brew doctor,將出現的warning一一按照指示解決(可能是之前作業系統升級至10.8時或是其他原因導致homebrew安裝的一些元件損壞)
  • 將ruby升級至1.9.3
    • rvm get head
    • rvm requirements,依照指示完成相關套件安裝
    • rvm install 1.9.3
    • rvm use 1.9.3 --default

完成後,這時gem update cocoapods就能順利進行了

pod install 安裝reachability時發生error

  • pod spec lint Reachability/3.0.0/Reachability.podspec
  • rake COCOAPODS_VERBOSE=1
  • 將Podfile內的reachability從3.0.0或其他版本資訊改成:head即可 (pod 'Reachability', :head)

這時再次執行pod install即可。

Reference