macos – 我在osx mavericks上更新后,Cocoa pods给出了ruby权限被拒绝错误

我到处搜索,问题似乎相似,但事实并非如此.我正在使用pod并需要更新它.一旦我发出
sudo gem更新
有很多错误,但可可豆荚更新到最新.现在我用任何选项运行pod我得到以下错误:

Last login: Mon Apr 21 03:48:44 on ttys000
mdhossain@Mds-MacBook-Pro ~ $pod --version
/Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:212:in `initialize': Permission denied - /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.1/gem_make.out (Errno::EACCES)
    from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:212:in `open'
    from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:212: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/specification.rb:925:in `block in find_inactive_by_path'
    from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in `each'
    from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in `find'
    from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:924:in `find_inactive_by_path'
    from /Library/Ruby/Site/2.0.0/rubygems.rb:185:in `try_activate'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
    from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.16.1/lib/xcodeproj/ext.rb:4: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/xcodeproj-0.16.1/lib/xcodeproj.rb:30: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/lib/cocoapods.rb:2: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>'
mdhossain@Mds-MacBook-Pro ~ $

我不确定为什么会这样.我重新安装了cocoapod,但这并没有解决问题.帮助你非常感谢.

最佳答案
当我更新到Yosemite时,我也遇到了这个问题
我通过使用..更新gem包解决了

$sudo gem update

更新$pod更新或$pod安装后,对我来说工作正常.

转载注明原文:macos – 我在osx mavericks上更新后,Cocoa pods给出了ruby权限被拒绝错误 - 代码日志