Ruby-build: Unable to install any ruby versions on macOs Big sur

Created on 11 Jan 2021  路  2Comments  路  Source: rbenv/ruby-build

Hi I'm trying to install Rbenv but I can't make it work on Big sur. I even Reinstall macOS.
I don't need to install some old ruby versions. My oldest project is running on ruby 2.6.3 so my clang version should not be the problem here (at least from what I understand 馃槄).

this is some info about my system
clang --version Apple clang version 12.0.0 (clang-1200.0.32.28) Target: x86_64-apple-darwin20.2.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Capture d鈥檈虂cran 2021-01-11 a虁 17 06 32

rbenv installation is going without any trouble but when I try to install a ruby -version with this what i get:

`rbenv install 3.0.0
Downloading ruby-3.0.0.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.gz
Installing ruby-3.0.0...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 11.1 using ruby-build 20201225)

Inspect or clean up the working tree at /var/folders/_f/g9ygp6q9791_2kvktnfvp4400000gn/T/ruby-build.20210111165550.47469.0jja58
Results logged to /var/folders/_f/g9ygp6q9791_2kvktnfvp4400000gn/T/ruby-build.20210111165550.47469.log

Last 10 log lines:
from :85:in require' from <internal:/private/var/folders/_f/g9ygp6q9791_2kvktnfvp4400000gn/T/ruby-build.20210111165550.47469.0jja58/ruby-3.0.0/lib/rubygems/core_ext/kernel_require.rb>:85:inrequire'
from /private/var/folders/_f/g9ygp6q9791_2kvktnfvp4400000gn/T/ruby-build.20210111165550.47469.0jja58/ruby-3.0.0/lib/rdoc/generator/markup.rb:60:in <top (required)>' from /private/var/folders/_f/g9ygp6q9791_2kvktnfvp4400000gn/T/ruby-build.20210111165550.47469.0jja58/ruby-3.0.0/lib/rdoc/generator/darkfish.rb:7:inrequire_relative'
from /private/var/folders/_f/g9ygp6q9791_2kvktnfvp4400000gn/T/ruby-build.20210111165550.47469.0jja58/ruby-3.0.0/lib/rdoc/generator/darkfish.rb:7:in <top (required)>' from /private/var/folders/_f/g9ygp6q9791_2kvktnfvp4400000gn/T/ruby-build.20210111165550.47469.0jja58/ruby-3.0.0/lib/rdoc/rdoc.rb:570:inrequire_relative'
from /private/var/folders/_f/g9ygp6q9791_2kvktnfvp4400000gn/T/ruby-build.20210111165550.47469.0jja58/ruby-3.0.0/lib/rdoc/rdoc.rb:570:in <top (required)>' from ./libexec/rdoc:16:inrequire'
from ./libexec/rdoc:16:in <main>' make: *** [rdoc] Error 1

From the log it's seem that's this is the problemcannot load such file -- strscan

I used to use rvm before but I also add some errors that's why I complety reinstall the OS and decide that it was a nice opportunity to try rbenv
Did someone faced the same trouble and have a link or explain to me how to install ruby versions on big sur with rbenv.

You can find attached the full log
Thanks
I
rbenv_ruby_3_0_0.log

Most helpful comment

Thank you so much @croisle !
After many hours of fighting with osx Big Sur, I was finally able to install versions of Ruby >= 2.6.4 using your command.
To be precise, I used it via asdf (which itself uses ruby-build):

MAKE_OPTS=-j1 RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml)" asdf install ruby 3.0.0

All 2 comments

Thanks to the 1st answer on this post https://stackoverflow.com/questions/65266692/big-sur-ruby-cannot-load-such-file-interrupted-system-call I found a solution.
I just had to change the ruby versions with the ones I needed

`MAKE_OPTS=-j1 RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml)" \
ruby-build --verbose 2.6.6 ~/.rbenv/versions/2.6.6/

then

rbenv rehash`

Thank you so much @croisle !
After many hours of fighting with osx Big Sur, I was finally able to install versions of Ruby >= 2.6.4 using your command.
To be precise, I used it via asdf (which itself uses ruby-build):

MAKE_OPTS=-j1 RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml)" asdf install ruby 3.0.0

Was this page helpful?
0 / 5 - 0 ratings