簡體   English   中英

無法安裝cocoapods 0.29

[英]Cannot install cocoapods 0.29

我成功安裝了cocoapods 0.29,在嘗試運行pod設置后,它聲稱我必須安裝0.29。

有人可以向我解釋一下嗎?

Successfully installed cocoapods-0.29.0
Parsing documentation for cocoapods-0.29.0
1 gem installed
bash-3.2$ pod setup
Setting up CocoaPods master repo
Already up-to-date.
[!] The `master` repo requires CocoaPods 0.29.0 - 
Update CocoaPods, or checkout the appropriate tag in the repo.

更新:

更新cocoapods后,我能夠運行pod設置,但仍然會收到0.29未安裝的錯誤:(而且,當運行pod --version時,它說我在0.22.3 ???)

bash-3.2$ sudo gem update cocoapods
Updating installed gems
Nothing to update
bash-3.2$ sudo pod setup
Setting up CocoaPods master repo
Already up-to-date.
Setup completed (read-only access)
bash-3.2$ pod install
Setting up CocoaPods master repo
Already up-to-date.
[!] The `master` repo requires CocoaPods 0.29.0 - 
Update CocoaPods, or checkout the appropriate tag in the repo.
/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide/command.rb:210:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
bash-3.2$ pod --version
0.22.3

導航此文件並將其刪除

/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide

然后打開你的終端添加這個

sudo gem更新

它為我工作100%

根據您的評論

$ type -a pod
pod is /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod
pod is /Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod
pod is /usr/bin/pod

看來你有多個Cocoapods安裝:一個在/Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod gem install cocoapodsgem install cocoapods ,另一個在/usr/bin/pod sudo gem install cocoapodssudo gem install cocoapods (我不知道/Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod是什么)。

所以運行gem install cocoapods應該通過更新/Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod的安裝來解決問題。

我建議通過刪除全局(使用sudo )或本地(不使用sudo )來清理安裝。

編輯

這是我的Jenkins安裝:

安裝Cocoapods與gem install cocoapods

運行type -a pod yield:

$ type -a pod
pod is /Users/Shared/Jenkins/Home/gems/bin/pod

在Jenkins全局配置中,我添加了以下環境變量:

GEM_HOME = $JENKINS_HOME/gems
GEM_PATH = $JENKINS_HOME/gems:/usr/lib/ruby/gems/1.8/
PATH = $PATH:$HOME/gems/bin

我為每個項目添加了一個“Shell腳本”構建步驟:

POD_PROJECT_DIRECTORY='MyProject'  # Directory where the Podfile is. Probably the same as Xcode plugin's "Xcode Project Directory".

cd "$WORKSPACE/$POD_PROJECT_DIRECTORY"
# rm -rf ./Pods  # Uncomment this line if you want to re-download all the Pods each time
pod install --no-color

我發現'pod --version'報告的版本不匹配,以及當我更新為神秘時我所看到的。 然后我意識到我的機器上安裝了多個紅寶石。 我更改了我的$ PATH,以便我首先需要使用ruby(例如/ usr / local / opt / ruby​​ / bin):

在一個新shell中,我發現'pod --version'開始報告我想要的'0.29.0'版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM