[英]Cannot install cocoapods 0.29
I successfully install cocoapods 0.29, and after attempting to run pod setup, it claims I must install 0.29. 我成功安装了cocoapods 0.29,在尝试运行pod设置后,它声称我必须安装0.29。
Can someone please explain this to me?? 有人可以向我解释一下吗?
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.
UPDATE: 更新:
After updating cocoapods, I am able to run pod setup, however still getting some error about 0.29 not being installed: (And also, when running pod --version, it says I'm on 0.22.3???) 更新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
navigate this file and delete it 导航此文件并将其删除
/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide /Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide
then open ur terminal add this 然后打开你的终端添加这个
sudo gem update sudo gem更新
its worked for me 100% 它为我工作100%
Based on your comment 根据您的评论
$ 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
it appears you have multiple installations of Cocoapods: one with gem install cocoapods
in /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod
and another with sudo gem install cocoapods
in /usr/bin/pod
(I don't know what /Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod
is). 看来你有多个Cocoapods安装:一个在/Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod
gem install cocoapods
了gem install cocoapods
,另一个在/usr/bin/pod
sudo gem install cocoapods
了sudo gem install cocoapods
(我不知道/Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod
是什么)。
So running gem install cocoapods
should fix the problem by updating the install in /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod
. 所以运行gem install cocoapods
应该通过更新/Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod
的安装来解决问题。
I'd recommend cleaning up your install though by removing either the global (with sudo
) one or the local (without sudo
) one. 我建议通过删除全局(使用sudo
)或本地(不使用sudo
)来清理安装。
EDIT : 编辑 :
Here's my Jenkins install: 这是我的Jenkins安装:
Installed Cocoapods with gem install cocoapods
. 安装Cocoapods与gem install cocoapods
。
Running type -a pod
yield: 运行type -a pod
yield:
$ type -a pod
pod is /Users/Shared/Jenkins/Home/gems/bin/pod
In the Jenkins global config, I added the following environment variables: 在Jenkins全局配置中,我添加了以下环境变量:
GEM_HOME = $JENKINS_HOME/gems
GEM_PATH = $JENKINS_HOME/gems:/usr/lib/ruby/gems/1.8/
PATH = $PATH:$HOME/gems/bin
I added a "Shell script" build step to each project with: 我为每个项目添加了一个“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
I found the mismatch of version reported by 'pod --version' and what I was seeing when I updated to be mystifying. 我发现'pod --version'报告的版本不匹配,以及当我更新为神秘时我所看到的。 Then I realized I had more than one ruby installed on my machine. 然后我意识到我的机器上安装了多个红宝石。 I changed my $PATH so that the ruby I needed to use came first (eg /usr/local/opt/ruby/bin): 我更改了我的$ PATH,以便我首先需要使用ruby(例如/ usr / local / opt / ruby / bin):
In a new shell I found that 'pod --version' started reporting the '0.29.0' version I wanted. 在一个新shell中,我发现'pod --version'开始报告我想要的'0.29.0'版本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.