ruby-build: 3.0.0-preview2 install failed (Mac OS X 10.15.7 using ruby-build 20201210)

$ rbenv install 3.0.0-preview2

Downloading openssl-1.1.1i.tar.gz… -> https://dqw8nmjcqpjn7.cloudfront.net/e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242 Installing openssl-1.1.1i… Installed openssl-1.1.1i to /Users/naro143/.rbenv/versions/3.0.0-preview2

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

BUILD FAILED (Mac OS X 10.15.7 using ruby-build 20201210)

Inspect or clean up the working tree at /var/folders/q7/xvn3h3gn2t18rdxx2n7grd_0wzqfmf/T/ruby-build.20201213040353.36221.Nqoey4 Results logged to /var/folders/q7/xvn3h3gn2t18rdxx2n7grd_0wzqfmf/T/ruby-build.20201213040353.36221.log

Last 10 log lines: compiling enc/unicode.c compiling enc/utf_8.c compiling enc/trans/newline.c ./revision.h unchanged compiling version.c linking miniruby generating x86_64-darwin19-fake.rb x86_64-darwin19-fake.rb updated make: *** [exe/ruby] Segmentation fault: 11 make: *** Deleting file `exe/ruby’ zsh: exit 1

$ xcodebuild -version Xcode 11.1 Build version 11A1027

$ sw_vers ProductName: Mac OS X ProductVersion: 10.15.7 BuildVersion: 19H2

3.0.0-preview1 install succeeds, but 3.0.0-preview2 install does not.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, all.

Can you try with the following instructions?

$ sudo rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
$ sudo xcode-select -s /Library/Developer/CommandLineTools

I think your developer toolchain is broken by macOS or Xcode upgrade installation.

I was having this same issue installing ruby 3.0.2 on Catalina. I got it to work by applying a patch that reverts this commit

  1. Save this into a file called my_custom_patch_file.patch
diff --git a/configure.ac b/configure.ac
index 2dcebdde9f..b11809c6d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -191,6 +191,13 @@ AS_CASE(["${build_os}"],
 ],
 [aix*], [
     AC_PATH_TOOL([NM], [nm], [/usr/ccs/bin/nm], [/usr/ccs/bin:$PATH])
+],
+[darwin*], [
+    AS_IF([libtool 2>&1 | grep no_warning_for_no_symbols > /dev/null], [
+        ac_cv_prog_ac_ct_RANLIB=:
+        ac_cv_prog_ac_ct_AR='libtool -static'
+        rb_cv_arflags='-no_warning_for_no_symbols -o'
+    ])
 ])
 AS_CASE(["${target_os}"],
 [cygwin*|mingw*], [
  1. Install via rbenv:
$ export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
$ rbenv install --patch 3.0.2 < /path/to/my_custom_patch_file.patch

Downloading ruby-3.0.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.2.tar.gz
Installing ruby-3.0.2...
patching file configure.ac
ruby-build: using readline from homebrew
Installed ruby-3.0.2 to /Users/asgeo1/.rbenv/versions/3.0.2

$ rbenv local 3.0.2
$ ruby --version
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin19]

I couldn’t reproduce it. ruby-build is working fine with my Catalina and Big Sur environment.

@hsbt This does not resolve the issue. I did what you asked on a Catalina Macbook Pro and the issue is still present. Applying the patch revert I mentioned does however work. I also have access to a Big Sur Macbook Pro that I can try with once the upgrade is done.

@hsbt Thank you! I had the same problem and your instructions fixed it for me.

@naro143 I get the same error (Segmentation fault: 11) when installing ruby 3.0.0. Did you solve it?