Cocoapods安装 - 找不到' minitest' (> = 5.1)(gem :: Missingspecerror)通过brew / error:执行宝石时...(errno :: eacces)通过gem
我正在对React Native进行移动开发。安装软件包后,我开始遇到错误,即POD上找不到一些模块。因此,我决定在几次失败的研究尝试后使用新模块更新整个软件包。但是,当尝试重新安装POD时,问题仍然存在。
因此,我决定通过Brew更新POD,但这并不成功。尽管我也卸载并安装了安装,但我尝试的其他事情仍然
是更新GEM和RVM,我尝试在其上安装Cocoapods,结果是没有
命令的差异列表,我在这里尝试了不同的时间,
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
....
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'
通过brew
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
进行通过宝石,
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
请帮助我,我被卡住了。 提前致谢。
I am running a mobile development on react native. After installing a package, I start getting error that some module isn't found on pod. So I decided to update the whole package.json with a new modules after several unsuccessful research attempts. But when try the pod re-installation, the issue still persist.
So I decided to update pod itself via brew, but it was not successful. Despite I also uninstall and install, it was still same
Other things I attempted is to update gem and rvm, on which i try to install the cocoapods and the result is no difference
list of commands I tried different times
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
Here is my .bash_profile
....
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'
VIA BREW
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
VIA GEM
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
Please help me I am stuck.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够通过简单地通过Visual Studio代码打开终端来解决它,这可以显示我的Mac所需的Ruby。像这样:
一切都起作用了!
I was able to resolve it by simply opening the terminal via Visual Studio Code and this displays the required Ruby for my Mac. Like this:
And everything worked!