LoginSignup
34
36

More than 5 years have passed since last update.

CocoaPodsのバージョンが上がらないハマリの解決

Last updated at Posted at 2013-05-13

FrogApps 技術ブログ始めました!
RailsやiOS、HTML5の情報を発信中!! → http://qiita.com/teams/frogapps


CocoaPodsのバージョンあげようとしてハマったのでメモ。

ハマリ

CocoaPodsを使おうとしたら、バージョン上げれとのエラーメッセージ。

$ pod install
Setting up CocoaPods master repo
Updating spec repo `master'

[!] The `master' repo requires CocoaPods 0.18.1 -
Update Cocoapods, or checkout the appropriate tag in the repo.

cocoapodsをupdate。

$ sudo gem install cocoapods
Successfully installed cocoapods-0.19.1
:

updateしたのにもかかわらず、podのバージョン見たら古い。バージョン上がってない><

$ pod --version
0.16.1

解決

gemやrubyはhomebrew製が動いてる。

$ which gem
/usr/local/bin/gem
$ which ruby
/usr/local/bin/ruby
$ gem which cocoapods
/usr/local/Cellar/ruby/1.9.3-p392/lib/ruby/gems/1.9.1/gems/cocoapods-0.19.1/lib/cocoapods.rb

/usr/bin/podの中身を見てみたらOS製のrubyを起動してました。

#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
#
# This file was generated by RubyGems.
:

homebrewのrubyから起動するように/usr/bin/podを書き換えちゃいました。

#!/usr/local/bin/ruby
#
:

これで、正しいバージョンが動くようになった。

$ pod --version
0.19.1
$

Twitterで岸川さんに確認方法を教えてもらったり、もっさりさんにつっこまれたりしました。感謝感謝です。
https://twitter.com/hirobe/status/333892818907058176

追記 2013.5.25
Installing Ruby gems not working with Home Brew
http://stackoverflow.com/questions/6482738/installing-ruby-gems-not-working-with-home-brew

34
36
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
34
36