Error installing gems: cannot download such file - zlib

I am trying to install gsm gb on Mac OS Yosmite

~/code/hello 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 

I have done the following:

  • Install zlib via homebrew
  • Rubygems Update
  • Reinstall RVM and Ruby 2.2.2
  • Switch to Rbenv and Ruby 2.2.2

It really works. Ruby 2.2.1 works fine, but 2.2.2 causes this problem when I try to install a gem.

Does anyone have any ideas?

+6
source share
2 answers

The following worked for me:

 brew install homebrew/dupes/zlib rvm reinstall 2.2.2 --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8 

Hope this helps someone else who comes across this.

+9
source

Try rvm pkg install zlib (from this question )

RVM pkg docs: https://rvm.io/packages


It also looks like RVM has a more modern way of managing packages called autolibs . Check out the rvm autolibs show , which I hope will be default(enabled) since you just installed. If not, rvm autolibs enable , or you can even tell him to use Homebrew instead of his own manager with rvm autolibs homebrew .

RVM autolibs docs: https://rvm.io/rvm/autolibs

+3
source

Source: https://habr.com/ru/post/987190/


All Articles