首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >COCOAPODS安装-通过brew / ERROR:在执行gem时找不到'minitest‘(>= 5.1) (Gem::MissingSpecError)。(Errno::EACCES)通过gem

COCOAPODS安装-通过brew / ERROR:在执行gem时找不到'minitest‘(>= 5.1) (Gem::MissingSpecError)。(Errno::EACCES)通过gem
EN

Stack Overflow用户
提问于 2022-06-25 17:28:16
回答 1查看 722关注 0票数 -1

我正在运行一个移动开发上的react本机。在安装了一个软件包后,我开始发现一些模块在pod上找不到的错误。因此,在几次失败的研究尝试之后,我决定用一个新的模块更新整个package.json。但是,当尝试重新安装吊舱时,问题仍然存在。

所以我决定通过brew更新pod本身,但是没有成功。尽管我也卸载和安装,但它仍然是一样的。

我尝试的其他事情是更新gem和rvm,我试着在它们上安装cocoapods,结果没有什么不同

我尝试了不同时间的命令列表

代码语言:javascript
运行
复制
sudo gem install cocoapods 

gem install cocoapods --user-install

sudo gem install -n /usr/local/bin cocoapods

sudo gem install -n /usr/local/bin cocoapods -v 1.8.4

brew install cocoapods

这是我的.bash_profile

代码语言:javascript
运行
复制
....
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH

source $(dirname $(gem which colorls))/tab_complete.sh
alias lc='colorls'

通过酿造

代码语言:javascript
运行
复制
Traceback (most recent call last):
        16: from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `<main>'
        15: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `activate_bin_path'
        14: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `synchronize'
        13: from /Library/Ruby/Site/2.6.0/rubygems.rb:286:in `block in activate_bin_path'
        12: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1398:in `activate'
        11: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `activate_dependencies'
        10: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `each'
         9: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1434:in `block in activate_dependencies'
         8: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1398:in `activate'
         7: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `activate_dependencies'
         6: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `each'
         5: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1434:in `block in activate_dependencies'
         4: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1398:in `activate'
         3: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `activate_dependencies'
         2: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `each'
         1: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1428:in `block in activate_dependencies'
/Library/Ruby/Site/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'minitest' (>= 5.1) among 41 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/mac/.gem/ruby/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0:/usr/local/Cellar/cocoapods/1.11.3/libexec' , execute `gem env` for more information
        16: from /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `<main>'
        15: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `activate_bin_path'
        14: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `synchronize'
        13: from /Library/Ruby/Site/2.6.0/rubygems.rb:286:in `block in activate_bin_path'
        12: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1398:in `activate'
        11: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `activate_dependencies'
        10: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `each'
         9: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1434:in `block in activate_dependencies'
         8: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1398:in `activate'
         7: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `activate_dependencies'
         6: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `each'
         5: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1434:in `block in activate_dependencies'
         4: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1398:in `activate'
         3: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `activate_dependencies'
         2: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1416:in `each'
         1: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1427:in `block in activate_dependencies'
/Library/Ruby/Site/2.6.0/rubygems/specification.rb:1430:in `rescue in block in activate_dependencies': Could not find 'minitest' (>= 5.1) among 41 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/mac/.gem/ruby/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0:/usr/local/Cellar/cocoapods/1.11.3/libexec' at: /usr/local/Cellar/cocoapods/1.11.3/libexec/specifications/activesupport-6.1.5.gemspec, execute `gem env` for more information

经宝石

代码语言:javascript
运行
复制
WARNING:  You don't have /Users/mac/.gem/ruby/2.6.0/bin in your PATH,
      gem executables will not run.
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_sysopen - /Users/mac/.gem/ruby/2.6.0/gems/ffi-1.15.5/CHANGELOG.md
Sylvester @ sudo gem install cocoapods --user-install
Password:
WARNING:  You don't have /Users/mac/.gem/ruby/2.6.0/bin in your PATH,
      gem executables will not run.
Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
    ERROR: Failed to build gem native extension.

    current directory: /Users/mac/.gem/ruby/2.6.0/gems/ffi-1.15.5/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20220625-94173-1we5ltp.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
    --with-ffi_c-dir
    --without-ffi_c-dir
    --with-ffi_c-include
    --without-ffi_c-include=${ffi_c-dir}/include
    --with-ffi_c-lib
    --without-ffi_c-lib=${ffi_c-dir}/lib
    --enable-system-libffi
    --disable-system-libffi
    --with-libffi-config
    --without-libffi-config
    --with-pkg-config
    --without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
    from extconf.rb:10:in `system_libffi_usable?'
    from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/mac/.gem/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/mac/.gem/ruby/2.6.0/gems/ffi-1.15.5 for inspection.
Results logged to /Users/mac/.gem/ruby/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.5/gem_make.out

请帮帮我我被卡住了。提前谢谢。

EN

Stack Overflow用户

发布于 2022-06-25 21:54:59

我只需通过Visual代码打开终端就可以解决这个问题,这将显示我的Mac所需的Ruby。如下所示:

代码语言:javascript
运行
复制
rvm install "ruby-2.7.4”

sudo gem install cocoapods

一切都成功了!

票数 0
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72755949

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档