我安装了CocoaPods并且它说Successfully installed cocoapods-0.33.1
,但无论我试图用pod
命令做什么,比如pod install
,我得到以下控制台输出:
Max$ pod install
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:6:in `rescue in <top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:3:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj.rb:30:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:32:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'
我正在使用Mac OS 10.10(Yosemite beta版)和Xcode 6.0 beta2,但我回想起当我使用Mavericks和Xcode 5.1.1时,我遇到了同样的问题。
答案 0 :(得分:9)
我终于解决了我的问题。
我必须安装ruby 2.1.2,然后重新安装cocoapods,一切正常。
brew doctor
的所有警告;
rvm
; rvm requirements
抱怨许多丢失的软件包,安装它们; rvm requirements
找不到,则建议使用gcc46。但问题是,安装 brew install apple-gcc42
可以解决问题。 rvm requirements
停止投诉,您可以安装ruby 2.1.2:rvm install 2.1.2
; rvm use 2.1.2
; 我可能会忘记一些事情,所以如果你有任何问题 - 请问。以下是一些帮助我的链接:
答案 1 :(得分:3)
- 打开Xcode 6
- 打开首选项
- 单击“位置”选项卡
- 将命令行工具版本更改为Xcode 6.0
- 卸载cocoapods
$ sudo gem uninstall cocoapods
- 安装xcodeproj
$ sudo gem install xcodeproj
- 安装cocoapods
$ sudo gem install cocoapods
- 运行pod。
答案 2 :(得分:2)
你很可能错过了一步,但这不是你的错。
sudo gem install cocoapods
pod setup
&lt; - 即使至关重要 pod install
答案 3 :(得分:1)
请参阅https://github.com/CocoaPods/CocoaPods/issues/2219
或者检查一下系统中是否有多ruby版本:rbenv versions
,并尝试rbenv global 1.9.x
更改ruby版本以进行安装。
答案 4 :(得分:1)
首先警告说您对bin目录的权限不安全:
本地:文件liuxiaojun $ gem update --system /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213:警告:PATH中的不安全世界可写dir / usr / bin,模式040777 更新rubygems-update 成功安装了rubygems-update-2.4.3 解析rubygems-update-2.4.3的文档 安装RubyGems 2.4.3 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213:警告:PATH中的不安全世界可写dir / usr / bin,模式040777 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213:警告:PATH中的不安全世界可写dir / usr / bin,模式040777 错误:执行gem时...(Errno :: EACCES) 权限被拒绝 - / Library/Ruby/Site/2.0.0/gauntlet_rubygems.rb
========== brew安装红宝石 行
答案 5 :(得分:0)
首先警告说您对bin目录的权限不安全:
warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
请参阅:warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
您可以通过(需要root凭据)修复它:
sudo chmod go-w /usr/local/bin
错误'require': cannot load such file
表示您有一些丢失或损坏的gem包。您可以通过重新安装cocoapods来修复它:
gem uninstall cocoapods # Follow by sudo if necessary
gem install cocoapods --verbose # Follow by sudo if necessary
确保您的xcodeproj存在:
gem install xcodeproj --verbose # Follow by sudo if necessary
答案 6 :(得分:0)
我的经验:升级到优胜美地之后我遇到了同样的错误,我刚做了一次&#34;宝石更新&#34;它起作用了。