Jekyll 安装失败,并显示“extconf 失败,退出代码 1”在 Mac 操作系统上

发布于 2025-01-15 17:53:47 字数 4103 浏览 2 评论 0原文

我按照 https://jekyllrb.com/docs/installation/macos/ 中的说明进行操作最终遇到了这个错误。以下是我一路上遇到的其他一些事情。

xcode-select --install

xcode-select:错误:命令行工具已安装,请使用“软件更新”安装更新

export SDKROOT=$(xcrun --show-sdk-path)

刚刚转到终端中的新行,没有任何消息。看起来很成功。

Install Homebrew

(已安装)

brew install ruby

致命:无法将 HEAD 解析为修订版本 警告:没有名称为“ruby”的可用公式。 ==>正在搜索类似名称的公式... 发现了这些类似命名的公式: 自制软件/portable-ruby/portable-libyaml 自制软件/便携式红宝石/便携式ncurses 自制软件/便携式红宝石/便携式openssl 自制软件/便携式红宝石/便携式readline 自制软件/便携式红宝石/便携式红宝石 自制软件/portable-ruby/portable-zlib 要安装其中之一,请运行(例如): brew 安装 homebrew/portable-ruby/portable-libyaml ==>正在搜索以前删除的公式(上个月)... 错误:找不到以前删除的公式。 ==>正在 GitHub 上搜索 Taps... 错误:在水龙头中找不到公式。

# If you're using Zsh
echo 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.6.0/bin:$PATH"' >> ~/.zshrc

刚刚转到终端中的新行,没有任何消息。看起来很成功。

退出并重新启动终端。

which ruby

/usr/bin/ruby

ruby -v

ruby 2.6.3p62(2019-04-16 修订版 67580)[universal.x86_64-darwin20]

gem install --user-install bundler jekyll

警告:您的 PATH 中没有 /Users/my-username/.gem/ruby/2.6.0/bin, gem 可执行文件将不会运行。成功安装bundler-2.3.9 解析bundler-2.3.9的文档 0 秒后完成捆绑程序的安装文档 构建本机扩展。这可能需要一段时间... 错误:安装 jekyll 时出错: 错误:无法构建 gem 本机扩展。

当前目录: /Users/我的用户名/.gem/ruby/2.6.0/gems/eventmachine-1.2.7/ext /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 ./siteconf20220321-36161-h5kjlp.rb extconf.rb 检查 -lcrypto... *** extconf.rb 失败 *** 由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件。 检查 mkmf.log 文件以获取更多详细信息。您可能需要配置 选项。

(省略一些配置信息)

<块引用>

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in try_do':编译器无法生成可执行文件。 (RuntimeError) 您必须先安装开发工具。来自 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:546:inblock in try_link0' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in mktmpdir' 来自 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:intry_link0' 来自 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:570:in try_link' 来自 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:789:intry_func' 来自 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1016:in /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in 中的 have_library' 中的块 checking_for' 中的块 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in 阻止(2级)推迟'来自/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:inopen'从 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in 阻止推迟'来自 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in打开'来自 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in 推迟'来自 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:inchecking_for' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1011:in 来自 extconf.rb:8:in 的 have_library'check_libs' 中的块 extconf.rb:8:在全部中?'来自 extconf.rb:8:incheck_libs' 来自 extconf.rb:95:in `'

要了解此扩展无法编译的原因,请检查 mkmf.log 可以在这里找到:

省略文件路径)

gem_make.out 文件链接在此处

Mac OS 11.6.3

I followed the instructions at https://jekyllrb.com/docs/installation/macos/ and ultimately ran into this error. Here are some other things I ran into along the way.

xcode-select --install

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

export SDKROOT=$(xcrun --show-sdk-path)

Just went to a new line in the terminal with no message. seemed successful.

Install Homebrew

(was already installed)

brew install ruby

fatal: Could not resolve HEAD to a revision
Warning: No available formula with the name "ruby".
==> Searching for similarly named formulae...
These similarly named formulae were found:
homebrew/portable-ruby/portable-libyaml
homebrew/portable-ruby/portable-ncurses
homebrew/portable-ruby/portable-openssl
homebrew/portable-ruby/portable-readline
homebrew/portable-ruby/portable-ruby
homebrew/portable-ruby/portable-zlib
To install one of them, run (for example):
brew install homebrew/portable-ruby/portable-libyaml
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

# If you're using Zsh
echo 'export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.6.0/bin:$PATH"' >> ~/.zshrc

Just went to a new line in the terminal with no message. seemed successful.

Quit and relaunched Terminal.

which ruby

/usr/bin/ruby

ruby -v

ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

gem install --user-install bundler jekyll

WARNING: You don't have /Users/my-username/.gem/ruby/2.6.0/bin in your PATH,
gem executables will not run. Successfully installed bundler-2.3.9
Parsing documentation for bundler-2.3.9
Done installing documentation for bundler after 0 seconds
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.

current directory:
/Users/my-username/.gem/ruby/2.6.0/gems/eventmachine-1.2.7/ext
/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 ./siteconf20220321-36161-h5kjlp.rb extconf.rb checking for -lcrypto... *** 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.

(some info about configuration omitted)

/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:546:inblock in try_link0' from
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in
mktmpdir' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:intry_link0' from
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:570:in
try_link' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:789:intry_func' from
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1016:in
block in have_library' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:inblock 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:inopen' 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:inopen' 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:inchecking_for' from
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1011:in
have_library' from extconf.rb:8:inblock in check_libs' from
extconf.rb:8:in all?' from extconf.rb:8:incheck_libs' from
extconf.rb:95:in `'

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

(file path omitted)

gem_make.out file linked here

Mac OS 11.6.3

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文