brew --prefix zlib
brew --prefix [email protected]
brew --prefix libyaml
/usr/local/Cellar/zlib/1.2.11
/usr/local/opt/[email protected]
/usr/local/opt/libyaml
➜ fpr git:(master) ✗
rbenv uninstall -f 1.9.3-p551
RUBY_CONFIGURE_OPTS="--with-zlib-dir=$(brew --prefix zlib) --with-openssl-dir=$(brew --prefix [email protected]) --with-libyaml-dir=$(brew --prefix libyaml)" rbenv install 1.9.3-p551
Downloading ruby-1.9.3-p551.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.tar.bz2
Installing ruby-1.9.3-p551...
WARNING: ruby-1.9.3-p551 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: using readline from homebrew
Installed ruby-1.9.3-p551 to /Users/jemminger/.rbenv/versions/1.9.3-p551
➜ fpr git:(master) ✗ gem install bundler -v'~>1.17.0'
/Users/jemminger/.rbenv/versions/1.9.3-p551/lib/ruby/1.9.1/yaml.rb:84:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
Exactly same issue here.
Also experiencing this issue on a very old project..
I'm having the same issue as user above me.
I am also having this issue
Same issue as well.
Are you using OpenSSL 1.1 or 1.0? See https://github.com/rbenv/ruby-build/wiki#openssl-version-compatibility
Just tried with OpenSSL 1.0...
$ RUBY_CONFIGURE_OPTS="--with-zlib-dir=$(brew --prefix zlib) --with-libyaml-dir=$(brew --prefix libyaml) --with-openssl-dir=$(brew --prefix [email protected])" rbenv install 1.9.3-p551
Same described issue.
FWIW, I reinstalled everything ~3 weeks ago, and rbenv install 1.9.3-p551 (no other config flag) worked without an issue (OS X Mojave)
MacOS Catalina here.
I'm receiving the same error, I tried even compiling manually and the behavior is the same
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])" ruby-build 1.9.3-p551 ~/.rubies/ruby-1.9.3
ruby-build: using libyaml from homebrew
Downloading ruby-1.9.3-p551.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p551.tar.bz2
Installing ruby-1.9.3-p551...
WARNING: ruby-1.9.3-p551 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: using readline from homebrew
Installed ruby-1.9.3-p551 to /Users/xavi/.rubies/ruby-1.9.3
Then:
/Users/xavi/.rubies/ruby-1.9.3/lib/ruby/1.9.1/yaml.rb:84:in `
To eliminate this warning, please install libyaml and reinstall your ruby.
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
The fix is to set CFLAGS, which was changed in xcode 12: https://github.com/rbenv/ruby-build/issues/1489
export CFLAGS="-Wno-error=implicit-function-declaration"
This was all I had to do. This solved my compilation problems with the downloaded/embedded openssl that ruby-build installs as well as the problems compiling ruby itself.
Try with https://github.com/rbenv/ruby-build/issues/1485#issuecomment-814180122 . I could install Ruby 1.9.3 with macOS Big Sur and Xcode 12.
Most helpful comment
MacOS Catalina here.