Skip to content

2.2.0 on Catalina: cannot load such file -- zlib (LoadError) #1473

@eexit

Description

@eexit

Hello,

I'm opening a new issue because I commented on a closed issue and I'm not sure I'd have any help there.
I recently did a fresh macOS install of Catalina (no upgrade) and I need to install Ruby 2.2.0 for my work.

Ruby seems to build successfully but when it comes to installing gem, it fails and seems not to find zlib:

brew install zlib rbenv ruby-build
brew install rbenv/tap/[email protected]
# ...

RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])" rbenv install 2.2.0
Downloading ruby-2.2.0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.0.tar.bz2
Installing ruby-2.2.0...

WARNING: ruby-2.2.0 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

BUILD FAILED (Mac OS X 10.15.6 using ruby-build 20200819)

Inspect or clean up the working tree at /var/folders/zr/xscq74t95293jr3k2dj75pyw0000gn/T/ruby-build.20200917111734.72324.wL7hCD
Results logged to /var/folders/zr/xscq74t95293jr3k2dj75pyw0000gn/T/ruby-build.20200917111734.72324.log

Last 10 log lines:
	from /private/var/folders/zr/xscq74t95293jr3k2dj75pyw0000gn/T/ruby-build.20200917111734.72324.wL7hCD/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
	from /private/var/folders/zr/xscq74t95293jr3k2dj75pyw0000gn/T/ruby-build.20200917111734.72324.wL7hCD/ruby-2.2.0/lib/rubygems.rb:556:in `install'
	from ./tool/rbinstall.rb:717:in `block (2 levels) in <main>'
	from ./tool/rbinstall.rb:716:in `each'
	from ./tool/rbinstall.rb:716:in `block in <main>'
	from ./tool/rbinstall.rb:749:in `call'
	from ./tool/rbinstall.rb:749:in `block in <main>'
	from ./tool/rbinstall.rb:746:in `each'
	from ./tool/rbinstall.rb:746:in `<main>'
make: *** [do-install-all] Error 1
zsh: exit 1

Full log: ruby-build.20200917111734.72324.log

Doctor output:

curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash

Checking for `rbenv' in PATH: /usr/local/bin/rbenv
Checking for rbenv shims in PATH: OK
Checking `rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20200819)
Counting installed Ruby versions: none
  There aren't any Ruby versions installed under `/Users/eexit/.rbenv/versions'.
  You can install Ruby versions like so: rbenv install 2.2.4
Checking RubyGems settings: OK
Auditing installed plugins: OK

I tried to reinstall Xcode but did not work.
I also tried using the following flags but did not work:

RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected]) --with-zlib-dir=$(brew --prefix zlib)" rbenv install 2.2.0

Any help would be greatly appreciated.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions