Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After OSX 10.10.4 update(?): Unable to install 2.2.0 or 2.2.1, run gem install bundler with 2.2.2 - missing zlib #780

Closed
davidcpell opened this issue Jul 6, 2015 · 2 comments

Comments

@davidcpell
Copy link

I've been having the following issues with rbenv since a recent uninstall/reinstall of rbenv and ruby-build (around the same time as updating to OSX 10.10.4 and Command Line Tools 6.4). I was uninstalling/reinstalling in hopes that it would fix an unrelated problem. However, I now can't build 2.2.0 or 2.2.1. I can build 2.2.2 but am unable to use gem install bundler due to a supposedly missing zlib package. I have run brew update, brew doctor, etc before installing rbenv and ruby-build.

MacBook-Pro:app me$ which ruby
/Users/me/.rbenv/shims/ruby
MacBook-Pro:app me$ rbenv versions
  system
* 2.2.2 (set by /Users/me/work/app/.ruby-version)
MacBook-Pro:app me$ gem install bundler
ERROR:  Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
MacBook-Pro:~ me$ rbenv install 2.2.0
Downloading ruby-2.2.0.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc
Installing ruby-2.2.0...

BUILD FAILED (OS X 10.10.4 using ruby-build 20150519)

Inspect or clean up the working tree at /var/folders/rm/38vbv5g952s54r1txrmrdlf40000gn/T/ruby-build.20150705212307.49958
Results logged to /var/folders/rm/38vbv5g952s54r1txrmrdlf40000gn/T/ruby-build.20150705212307.49958.log

Last 10 log lines:
    from /private/var/folders/rm/38vbv5g952s54r1txrmrdlf40000gn/T/ruby-build.20150705212307.49958/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /private/var/folders/rm/38vbv5g952s54r1txrmrdlf40000gn/T/ruby-build.20150705212307.49958/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 

When I open up the error log and find the point of failure, it's the same as the above bundler problem with 2.2.2:

installing default gems:      /Users/me/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
                              bigdecimal 1.2.6
                              io-console 0.4.3
                              json 1.8.1
                              psych 2.0.8
                              rake 10.4.2
                              rdoc 4.2.0
installing bundle gems:       /Users/me/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
/private/var/folders/rm/38vbv5g952s54r1txrmrdlf40000gn/T/ruby-build.20150705212307.49958/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- zlib (LoadError)

I have seen similar problems with cannot load such file -- zlib (it's even mentioned in the wiki) but that normally seems to be a problem with Linux systems rather than OSX.

I'm at the end of what I know to do to try to debug this and I thought I would mention/report it here.

OSX 10.10.4
Command Line Tools 6.4
rbenv 0.4.0
ruby-build 20150519

@davidcpell davidcpell changed the title After OSX 10.10.4 update: Unable to install 2.2.0 or 2.2.1, run gem install bundler with 2.2.2 After OSX 10.10.4 update(?): Unable to install 2.2.0 or 2.2.1, run gem install bundler with 2.2.2 Jul 6, 2015
@davidcpell davidcpell changed the title After OSX 10.10.4 update(?): Unable to install 2.2.0 or 2.2.1, run gem install bundler with 2.2.2 After OSX 10.10.4 update(?): Unable to install 2.2.0 or 2.2.1, run gem install bundler with 2.2.2 - missing zlib Jul 6, 2015
@davidcpell
Copy link
Author

well...it looks like zlib must be in Xcode proper and not Command Line Tools...and either something happened to my Xcode installation or I needed to update it manually after the OSX 10.10.4 upgrade. I checked the App Store and noticed I was able to update it and, after I did, the problem went away. I'll go ahead and close this!

@eexit
Copy link

eexit commented Sep 17, 2020

Hello,

Sorry to reopen this topic but I have the same problem on Catalina. My installation is fresh, I even reinstalled XCode and no matter what I'm trying, it won't install Ruby 2.2.0:

brew install zlib rbenv ruby-build
brew install rbenv/tap/openssl@1.0
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" 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

In the logs, near the end:

config.status: creating x86_64-darwin19-fake.rb
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-darwin19-fake ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --install=all --rdoc-output=".ext/rdoc"
installing binary commands:   /Users/jberthelot/.rbenv/versions/2.2.0/bin
installing base libraries:    /Users/jberthelot/.rbenv/versions/2.2.0/lib
installing arch files:        /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/2.2.0/x86_64-darwin19
installing pkgconfig data:    /Users/jberthelot/.rbenv/versions/2.2.0/lib/pkgconfig
installing command scripts:   /Users/jberthelot/.rbenv/versions/2.2.0/bin
installing library scripts:   /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/2.2.0
installing common headers:    /Users/jberthelot/.rbenv/versions/2.2.0/include/ruby-2.2.0
installing manpages:          /Users/jberthelot/.rbenv/versions/2.2.0/share/man/man1
installing extension objects: /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/2.2.0/x86_64-darwin19
installing extension objects: /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/site_ruby/2.2.0/x86_64-darwin19
installing extension objects: /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/vendor_ruby/2.2.0/x86_64-darwin19
installing extension headers: /Users/jberthelot/.rbenv/versions/2.2.0/include/ruby-2.2.0/x86_64-darwin19
installing extension scripts: /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/2.2.0
installing extension scripts: /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/site_ruby/2.2.0
installing extension scripts: /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/vendor_ruby/2.2.0
installing extension headers: /Users/jberthelot/.rbenv/versions/2.2.0/include/ruby-2.2.0/ruby
installing default gems:      /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
                              bigdecimal 1.2.6
                              io-console 0.4.3
                              json 1.8.1
                              psych 2.0.8
                              rake 10.4.2
                              rdoc 4.2.0
installing bundle gems:       /Users/jberthelot/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
/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': cannot load such file -- zlib (LoadError)
	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/package.rb:46:in `<top (required)>'
	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/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/dependency_installer.rb:3:in `<top (required)>'
	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/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

It seems that Ruby is compiling just fine but gem is failing.

Rbenv-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/jberthelot/.rbenv/versions'.
  You can install Ruby versions like so: rbenv install 2.2.4
Checking RubyGems settings: OK
Auditing installed plugins: OK
ll /usr/lib/libz*
lrwxr-xr-x 1 root wheel   12 Aug 28 15:54 /usr/lib/libz.1.1.3.dylib -> libz.1.dylib
lrwxr-xr-x 1 root wheel   12 Aug 28 15:54 /usr/lib/libz.1.2.11.dylib -> libz.1.dylib
lrwxr-xr-x 1 root wheel   12 Aug 28 15:54 /usr/lib/libz.1.2.5.dylib -> libz.1.dylib
lrwxr-xr-x 1 root wheel   12 Aug 28 15:54 /usr/lib/libz.1.2.8.dylib -> libz.1.dylib
-rwxr-xr-x 1 root wheel 104K Aug 10 20:39 /usr/lib/libz.1.dylib
lrwxr-xr-x 1 root wheel   12 Aug 28 15:54 /usr/lib/libz.dylib -> libz.1.dylib

Any help would be greatly appreciated.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants