0

UPDATE

I also have run

ruby -rzlib -e0

and I get this

/Users/bertuka/.rvm/rubies/ruby-2.4.2/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- zlib (LoadError)
    from /Users/bertuka/.rvm/rubies/ruby-2.4.2/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'

It seems as if I had a version installed inside another version, but I do not know how to solve it

I tried to uninstall Ruby version 2.4.2 and reinstall it, but I still get the same error


FIRST MESSAGE

I am trying to install compass on my mac to use GRUNT.

When I type the following line on terminal

sudo gem install compass

an error appears

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 ruby installed

ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

and I tried to run the following command as I see on rbenv installed ruby 2.1.2 cannot load such file -- zlib on MAC OSX 10.9.2

xcode-select --install

But it seems that I already have it installed

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

I don't now how to install zlib and compass correctly to avoid errors.

Sorry for my english, thanks.

Berta Nicolau
  • 128
  • 1
  • 8

1 Answers1

0

Most places similar errors have happened previously (ex. https://github.com/rbenv/rbenv/issues/573) people have suggested either uninstalling and reinstalling XCode:

See: Xcode 6.1 - How to uninstall command line tools?

or uninstalling and reinstall homebrew:

See: What is the best/safest way to reinstall Homebrew?

You may also have to start a new terminal between changes to your ruby installation.

aaron blythe
  • 324
  • 1
  • 7
  • Thanks for your answer. I have installed xcode three times and also command line tools. I've also reinstalled the homebrew, I do not know what else I can do. – Berta Nicolau May 02 '18 at 09:21
  • What method are you using for ruby install? Is it rbenv? have you tried uninstalling/reinstalling ruby? Can you give the output of `which ruby` and `which zlib` showing the paths to the tools? Perhaps installing zlib from homebrew will help this situation `brew install zlib` – aaron blythe May 03 '18 at 16:33