无法在 MacOS Mojave 上安装 ruby

无法在 MacOS Mojave 上安装 ruby

我有一台运行 Mojave 的新 MBP,正在尝试安装 ruby​​ v2.6.5。我已经安装了 Homebrew,正在尝试通过以下方式安装 ruby安省,它使用 ruby​​-build。

安装一直挂起并显示消息ruby-build: using readline from homebrew。我在互联网上发现其他人也遇到了类似的问题,但尚未真正解决。我想知道这里有没有人遇到过这种情况并找到了解决办法?

mbp:dotfiles $ asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git
mbp:dotfiles $ asdf install ruby 2.6.5
Downloading ruby-build...
Cloning into 'ruby-build-source'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 9941 (delta 0), reused 0 (delta 0), pack-reused 9940
Receiving objects: 100% (9941/9941), 2.10 MiB | 8.70 MiB/s, done.
Resolving deltas: 100% (6477/6477), done.
Note: switching to 'v20191004'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at da8e0b4 Bump version to v20191004
ruby-build: using openssl from homebrew
Downloading ruby-2.6.5.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
Installing ruby-2.6.5...
ruby-build: using readline from homebrew

答案1

首先,您没有提供完整的错误信息。

可能的原因是您正在尝试安装不兼容 openssl 版本的 ruby​​。检查这些链接,也许会有所帮助:

为了解决这个问题,你可能需要更新 ruby​​ asdf 插件asdf plugin update ruby

相关内容