在Mac上安装Ruby 2.7.5 12.6.7与RVM

bfnvny8b  于 2023-08-04  发布在  Ruby
关注(0)|答案(1)|浏览(238)

我已经解决了很多github问题和其他类似的堆栈溢出问题。我仍然无法成功让RVM正确找到我的openssl或安装React Native的2.7.5。我用的是OSX 12.6.7。

rvm reinstall 2.7.5
ruby-2.7.5 - #removing src/ruby-2.7.5 - please wait
ruby-2.7.5 - #removing rubies/ruby-2.7.5 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/12.6/x86_64/ruby-2.7.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_brew.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/x/.rvm/rubies/ruby-2.7.5, this may take a while depending on your cpu(s)...
ruby-2.7.5 - #downloading ruby-2.7.5, this may take a while depending on your connection...
ruby-2.7.5 - #extracting ruby-2.7.5 to /Users/x/.rvm/src/ruby-2.7.5 - please wait
ruby-2.7.5 - #configuring - please wait
ruby-2.7.5 - #post-configuration - please wait
ruby-2.7.5 - #compiling - please wait
ruby-2.7.5 - #installing - please wait
Error running '__rvm_make install',
please read /Users/x/.rvm/log/1688495709_ruby-2.7.5/install.log
There has been an error while running make install. Halting the installation.

字符串
这里是我的/usr/local/opt

lrwxr-xr-x    1 x  admin    27 Jul  3 11:58 openssl -> ../Cellar/openssl@3/3.1.1_1
lrwxr-xr-x    1 x  admin    28 Jul  3 11:55 openssl@1.1 -> ../Cellar/openssl@1.1/1.1.1u
lrwxr-xr-x    1 x  admin    27 Jul  3 11:58 openssl@3 -> ../Cellar/openssl@3/3.1.1_1
lrwxr-xr-x    1 x  admin    27 Jul  3 11:58 openssl@3.1 -> ../Cellar/openssl@3/3.1.1_1


错误来自.rvm/log/1688493800_ruby-2.7.5/install.log

/Users//.rvm/src/ruby-2.7.5/lib/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- openssl (LoadError)
    from /Users//.rvm/src/ruby-2.7.5/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
    from /Users//.rvm/src/ruby-2.7.5/lib/rubygems/specification.rb:2430:in `to_ruby'
    from ./tool/rbinstall.rb:846:in `block (2 levels) in install_default_gem'
    from ./tool/rbinstall.rb:279:in `open_for_install'
    from ./tool/rbinstall.rb:845:in `block in install_default_gem'
    from ./tool/rbinstall.rb:835:in `each'
    from ./tool/rbinstall.rb:835:in `install_default_gem'
    from ./tool/rbinstall.rb:799:in `block in <main>'
    from ./tool/rbinstall.rb:950:in `block in <main>'
    from ./tool/rbinstall.rb:947:in `each'
    from ./tool/rbinstall.rb:947:in `<main>'
make: *** [do-install-nodoc] Error 1


来自.rvm/src/ruby-2.7.5/ext/openssl/mkmf.log的错误

/Users/x/.rvm/src/ruby-2.7.5/ext/openssl/extconf.rb:111: OpenSSL >= 1.0.1, < 3.0.0 or LibreSSL >= 2.5.0 is required
    /Users/x/.rvm/src/ruby-2.7.5/ext/openssl/extconf.rb:111:in `<top (required)>'
    ./ext/extmk.rb:214:in `load'
    ./ext/extmk.rb:214:in `block in extmake'
    /Users/x/.rvm/src/ruby-2.7.5/lib/mkmf.rb:331:in `open'
    ./ext/extmk.rb:210:in `extmake'
    ./ext/extmk.rb:572:in `block in <main>'
    ./ext/extmk.rb:568:in `each'
    ./ext/extmk.rb:568:in `<main>'


我很困惑,为什么它不能找到正确的openssl版本时,我明明有它安装。感谢并乐意提供任何可能有助于调试问题的缺失信息。

qkf9rpyu

qkf9rpyu1#

我通过删除openssl@3,安装ruby 2.7.5,然后重新安装openssl@3来修复这个问题。

brew uninstall --ignore-dependencies openssl@3
rvm reinstall 2.7.5
brew install openssl@3

字符串

相关问题