gpt4 book ai didi

ruby - 使用 RVM 在 OSX 10.15.2 Catalina 中安装 Ruby 2.3.8 时出错;未找到 OpenSSL

转载 作者:行者123 更新时间:2023-12-03 14:40:34 25 4
gpt4 key购买 nike

错误
Error running 'env GEM_HOME=/Users/john/.rvm/gems/ruby-2.3.8@global
我在尝试安装 ruby​​ 时遇到此错误 2.3.8在 MacOs Catalina 10.15.2

$ rvm install 2.3.8


Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.3.8.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/john/.rvm/rubies/ruby-2.3.8, this may take a while depending on your cpu(s)...
ruby-2.3.8 - #downloading ruby-2.3.8, this may take a while depending on your connection...
ruby-2.3.8 - #extracting ruby-2.3.8 to /Users/john/.rvm/src/ruby-2.3.8 - please wait
ruby-2.3.8 - #configuring - please wait
ruby-2.3.8 - #post-configuration - please wait
ruby-2.3.8 - #compiling - please wait
ruby-2.3.8 - #installing - please wait
ruby-2.3.8 - #making binaries executable - please wait
ruby-2.3.8 - #downloading rubygems-3.0.8
ruby-2.3.8 - #extracting rubygems-3.0.8 - please wait
ruby-2.3.8 - #removing old rubygems - please wait
ruby-2.3.8 - #installing rubygems-3.0.8 - please wait

Error running 'env GEM_HOME=/Users/john/.rvm/gems/ruby-2.3.8@global GEM_PATH= /Users/john/.rvm/rubies/ruby-2.3.8/bin/ruby -d /Users/john/.rvm/src/rubygems-3.0.8/setup.rb --no-document',

please read /Users/john/.rvm/log/1583757882_ruby-2.3.8/rubygems.install.log

日志输出
$ cat /Users/john/.rvm/log/1583757882_ruby-2.3.8/rubygems.install.log


...skipping...
Exception `LoadError' at /Users/john/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/rubygems.rb:1242 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /Users/john/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/rubygems.rb:1251 - cannot load such file -- rubygems/defaults/ruby
Exception `LoadError' at /Users/john/.rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55 - cannot load such file -- did_you_mean
/Users/john/.rvm/src/rubygems-3.0.8/lib/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- openssl (LoadError)
from /Users/john/.rvm/src/rubygems-3.0.8/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/john/.rvm/src/rubygems-3.0.8/lib/rubygems/specification.rb:2481:in `to_ruby'
from /Users/john/.rvm/src/rubygems-3.0.8/lib/rubygems/commands/setup_command.rb:405:in `install_default_bundler_gem'
from /Users/john/.rvm/src/rubygems-3.0.8/lib/rubygems/commands/setup_command.rb:167:in `execute'
from /Users/john/.rvm/src/rubygems-3.0.8/lib/rubygems/command.rb:321:in `invoke_with_build_args'
from /Users/john/.rvm/src/rubygems-3.0.8/lib/rubygems/command_manager.rb:184:in `process_args'
from /Users/john/.rvm/src/rubygems-3.0.8/lib/rubygems/command_manager.rb:148:in `run'
from /Users/john/.rvm/src/rubygems-3.0.8/lib/rubygems/gem_runner.rb:59:in `run'
from setup.rb:41:in `<main>'

要点是
`require': cannot load such file -- openssl (LoadError)

我试过

深入挖掘,我发现较新版本的 OSX 已弃用 OpenSSL,导致许多依赖项被破坏。您需要重新安装 ruby​​,但要准确指定 OpenSSL 库的位置。如果您使用的是 RVM,则如下所示:
$ brew install openssl
$ rvm reinstall 2.3.8 --with-openssl-dir=`brew --prefix openssl`

但没有用,错误没有改变。

然后我试过了
$ rvm reinstall 2.3.8 --rubygems 2.6.6 --with-openssl-dir=`brew --prefix openssl`


Error running '__rvm_with ruby-2.3.8@myapp gemset_pristine',
please read /Users/john/.rvm/log/1583758650_ruby-2.3.8/gemset.pristine-ruby-2.3.8@myapp

说,没有安装 nokogiri,
$ gem install nokogiri -v=1.10.4

ERROR: While executing gem ... (Gem::Exception)
Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

知道如何解决这个问题吗?

最佳答案

我尝试了所有方法并得出结论,ruby 2.3.8 的二进制文件存在问题。 RVM有。我删除了 RVM从我的系统开始使用 rbenv .

与家酿

$ brew install rbenv
$ rbenv init
# Do as it says
$ rbenv install 2.3.8

还要确保您使用 bundler在旧代码的 Gemfile.lock 中指定

关于ruby - 使用 RVM 在 OSX 10.15.2 Catalina 中安装 Ruby 2.3.8 时出错;未找到 OpenSSL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60599412/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com