我刚刚学习使用 cocoapods,在尝试安装 pod 时遇到错误。
错误顶部:
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi/library.rb:275: [BUG] 0x00000001045b8000 ruby 2.6.3p62 处的总线错误(2019-04-16 修订版 67580)[通用.arm64e-darwin20]
错误底部:
zsh:中止 pod 安装
按照此处和 GitHub 上一些线程的建议,已尝试以下操作:
但似乎没有什么效果;错误仍然存在,并且 .xcworkspace 文件不出现。
任何帮助将非常感激。谢谢你!
自从升级到优胜美地后,我发现此错误试图构建包括ruby.h以下内容的任何内容:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^
1 error generated.
make[1]: *** [objects/if_ruby.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [first] Error 2
Run Code Online (Sandbox Code Playgroud)
果然,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/config.h确实缺失了.
$ ls -laF /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/
total 72
drwxr-xr-x 21 root wheel 714 Jul 29 21:56 ./
drwxr-xr-x 5 root wheel 170 Jul 29 21:56 ../
drwxr-xr-x 7 root wheel 238 Jul 29 21:56 backward/
-rw-r--r-- 2 root wheel 3360 Sep 21 …Run Code Online (Sandbox Code Playgroud) 我想在 MacOS 上安装 cocoapods 来运行 pod 命令。但是在做
sudo gem install cocoa-pods
Run Code Online (Sandbox Code Playgroud)
我得到以下信息:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.7.0/gems/ffi-1.13.1/ext/ffi_c
/usr/local/opt/ruby/bin/ruby -I /usr/local/Cellar/ruby/2.7.1_2/lib/ruby/2.7.0 -r ./siteconf20200702-22528-1o4wbn0.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
--with-opt-include
--without-opt-include=${opt-dir}/include …Run Code Online (Sandbox Code Playgroud) 我正在学习如何编程,我正在尝试安装 Cocoapods,但是我在sudo gem install cocoapods.
这就是我得到的:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20201006-615-fryp4a.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 …Run Code Online (Sandbox Code Playgroud) 我该怎么办,依赖关系有问题吗?我该如何解决这些问题?我在卡特琳娜。
我反复收到此错误,并且已经查找了目录.. 不存在。
sudo bundle update
Password:
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.......
Bundler found conflicting requirements for the Ruby
version:
In Gemfile:
github-pages was resolved to 1, which depends on
Ruby (~> 1.9.3)
jekyll-feed (~> 0.12) was resolved to 0.13.0, which
depends on
Ruby (>= 2.3.0)
Bundler could not find compatible versions for gem
"commonmarker":
In Gemfile:
commonmarker (~> 0.21.0)
github-pages was resolved to 203, which depends on
jekyll-commonmark-ghpages (= 0.1.6) was resolved …Run Code Online (Sandbox Code Playgroud)