-
Notifications
You must be signed in to change notification settings - Fork 791
Description
Hardware: Apple M1 MacBook Air running Big Sur 11.6.8
OpenSSL: Both 1.1 and 3.0 installed using brew with 3.0 as the linked default
Step 1: Run rbenv install 3.1.2
milos@air:~$ rbenv install 3.1.2
To follow progress, use 'tail -f /var/folders/y5/vfyf5lqj655g_zbm8pvdgmkr0000gn/T/ruby-build.20221029165815.98770.log' or pass --verbose
Downloading openssl-3.0.5.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/aa7d8d9bef71ad6525c55ba11e5f4397889ce49c2c9349dcea6d3e4f0b024a7a
Installing openssl-3.0.5...
Installed openssl-3.0.5 to /Users/milos/.rbenv/versions/3.1.2
Downloading ruby-3.1.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.2.tar.gz
Installing ruby-3.1.2...
ruby-build: using readline from homebrew
ruby-build: using gmp from homebrew
BUILD FAILED (macOS 11.6.8 using ruby-build 20221004)
Inspect or clean up the working tree at /var/folders/y5/vfyf5lqj655g_zbm8pvdgmkr0000gn/T/ruby-build.20221029165815.98770.ztN4k5
Results logged to /var/folders/y5/vfyf5lqj655g_zbm8pvdgmkr0000gn/T/ruby-build.20221029165815.98770.log
Last 10 log lines:
from ./tool/rbinstall.rb:899:in `block in install'
from ./tool/rbinstall.rb:713:in `no_write'
from ./tool/rbinstall.rb:899:in `install'
from ./tool/rbinstall.rb:1068:in `block (2 levels) in <main>'
from ./tool/rbinstall.rb:1043:in `foreach'
from ./tool/rbinstall.rb:1043:in `block in <main>'
from ./tool/rbinstall.rb:1127:in `block in <main>'
from ./tool/rbinstall.rb:1124:in `each'
from ./tool/rbinstall.rb:1124:in `<main>'
make: *** [do-install-all] Error 1
Step 2: Notice that rbenv versions
does not show 3.1.2 because it failed to install using ruby-build
milos@air:~$ rbenv versions
system
* 2.7.4 (set by /Users/milos/.rbenv/version)
3.0.4
Step 3: Install 3.1.2 manually from source, bypassing ruby-build entirely
wget https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.2.tar.gz
tar xf ruby-3.1.2.tar.gz
cd ruby-3.1.2
./configure --prefix=/Users/milos/.rbenv/versions/3.1.2 # add `--with-openssl-dir=/opt/homebrew/opt/openssl\@1.1` or @3 as preferred, if needed
make -j9
make install
Step 4: Notice that rbenv versions
now shows 3.1.2 successfully installed
milos@air:~$ rbenv versions
system
* 2.7.4 (set by /Users/milos/.rbenv/version)
3.0.4
3.1.2
milos@air:~$ rbenv global 3.1.2
milos@air:~$ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin20]
milos@air:~$ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
OpenSSL 3.0.5 5 Jul 2022
Please do not move this to the Discussions tab as the installation works when not using ruby-build. This leads me to believe that it is indeed a ruby-build issue.
For what it's worth, I can install ruby 3.1.2 this way with either OpenSSL 3.0 or OpenSSL 1.1 depending on what I provide in the configure step. I can provide --with-openssl-dir=/opt/homebrew/opt/openssl\@1.1
to override the 3.0 default that brew linked. Both work. However, again, with ruby-build the installation fails as per my report in #1961
Thanks to #1961 (reply in thread) for finding this workaround that makes the source build usable with rbenv.