1

我正在使用 OSX Yoemite,我在 StackOverflow 上访问了几乎所有有关此问题的问题,但没有一个答案有效……我目前正在尝试使用命令“pod install”,但出现此错误:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir': Permission denied - /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-14/2.0.0/xcodeproj-0.16.1 (Errno::EACCES)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:210:in `write_gem_make_out'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:132:in `build_error'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:171:in `rescue in build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:156:in `build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1436:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/user_interaction.rb:45:in `use_ui'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1434:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:68:in `block in require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `find'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.32.1/lib/cocoapods.rb:1:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.32.1/bin/pod:32:in `<top (required)>'
from /usr/bin/pod:23:in `load'
from /usr/bin/pod:23:in `<main>'

它还说:错误:无法构建 gem 原生扩展。有谁知道如何解决这一问题?谢谢!

4

3 回答 3

4

试试这个(使用 OSX 10.10 为我工作)

  1. 打开 Xcode 6
  2. 打开首选项
  3. 单击位置选项卡
  4. 将命令行工具版本更改为 Xcode 6.0
  5. 卸载 cocoapods

    $ sudo gem 卸载 cocoapods

  6. 安装 xcodeproj

    $ sudo gem 安装 xcodeproj

  7. 安装 cocoapods

    $ sudo gem 安装 cocoapods

运行pod --version验证

于 2014-07-02T17:09:18.233 回答
2
 rvm reinstall ruby-2.0.0-p247 --with-gcc=clang --verify-downloads 1
 gem install xcodeproj
 gem install cocoapods

试试这些可能有帮助的

于 2014-07-10T13:32:40.237 回答
0

好的,我知道我在这里聚会迟到了,但这里有一些信息给后代,以防他们遇到和我一样的问题。

我遇到的问题是由于我的项目目录是由另一个用户创建的(因此我没有执行 mkdir 的权限)。更新权限(或者在我的情况下,使用我的用户帐户重新创建项目目录)解决了这个问题。

希望这可以帮助!:)

于 2015-10-27T22:13:58.790 回答