ruby-build: 2.7.2 won't install using Homebrew (macOS 10.15.7, Darwin 19.6.0)
Title says it all… I get a missing dependency error for libyaml (required to build the psych gem) even though libyaml is correctly installed:
$ brew install libyaml
Warning: libyaml 0.2.5 is already installed and up-to-date
To reinstall 0.2.5, run `brew reinstall libyaml`
$ brew reinstall libyaml
==> Downloading https://homebrew.bintray.com/bottles/libyaml-0.2.5.catalina.bott
######################################################################## 100.0%
==> Reinstalling libyaml
==> Pouring libyaml-0.2.5.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/libyaml/0.2.5: 10 files, 323.5KB
$ brew cleanup
$ rbenv install 2.7.2
Downloading openssl-1.1.1g.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46
Installing openssl-1.1.1g...
Installed openssl-1.1.1g to /Users/stevewi/.rbenv/versions/2.7.2
Downloading ruby-2.7.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.tar.bz2
Installing ruby-2.7.2...
ruby-build: using readline from homebrew
BUILD FAILED (Mac OS X 10.15.7 using ruby-build 20201005)
Inspect or clean up the working tree at /var/folders/pj/qdpn6dzn7ds24bpb6x0jmtcc0000gn/T/ruby-build.20201011092736.97275.wciA9q
Results logged to /var/folders/pj/qdpn6dzn7ds24bpb6x0jmtcc0000gn/T/ruby-build.20201011092736.97275.log
Last 10 log lines:
The Ruby yaml extension was not compiled.
ERROR: Ruby install aborted due to missing extensions
Configure options used:
--prefix=/Users/stevewi/.rbenv/versions/2.7.2
--with-openssl-dir=/Users/stevewi/.rbenv/versions/2.7.2/openssl
--enable-shared
--with-readline-dir=/usr/local/opt/readline
CC=clang
LDFLAGS=-L/Users/stevewi/.rbenv/versions/2.7.2/lib
CPPFLAGS=-I/Users/stevewi/.rbenv/versions/2.7.2/include
I filed this same defect on rbenv/rbenv…which was probably the wrong place… I couldn’t figure out how to move it here so the one on rbenv/rbenv. should probably be closed in favor of this one.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 26 (2 by maintainers)
Another datapoint: I had the same problem except I’m using
asdf
to manage ruby versions. (asdf
seems to userbenv
under the hood anyway.)I tried
RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl@1.1 --with-libyaml-dir=/usr/local/opt/libyaml" asdf install ruby 2.7.2
which failedI then went into the folder that it told me in
Inspect or clean up the working tree at /var/folders/r6/35d6jll131j9s3q4yzvgxqqc0000gn/T/ruby-build.20201106122657.49603.Od1EaH
In the folder I did:
followed by
Additionally I had to do the following to get my project to build again
ruby-2.7.2-install.log
Removing .gem:
allowed 2.7.2 to install successfully but I got the same error as before with 2.7.1.
A new version of ruby-build dropped today…20201118:
Here’s the results of the previous experiment with the new version:
The nature of the failure is the same as described in the OP.
A new version of ruby-build dropped today…20201117. Here’s the results of the previous experiment with the new version:
The nature of the failure is the same as described in the OP.
@yaroslav writes:
Since it’s not reliable (see below); it doesn’t really matter “if it is a tidy or proper way, or should be recommended at all, though.” The only reliable way I’ve found to make this work is to extract it and configure/build it manually (as noted above).
@thewalkingtoast writes:
Among recent ruby’s, 2.7.2 appears to be an anomaly. Here’s the results of my experiments:
IMHO, this kind of defeats the purpose of rbenv. It’s looking more and more like all this activity is going nowhere… Have any of the developers responded?