How to fix zlib error in ruby?

Freeman Source

When I write this command :

gem install bundler && bundle install --without test

the output is :

ERROR:  Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

so, obviously I tried to install zlib1g-dev and libssl-dev but it was already installed on my system,

#sudo apt-get install zlib1g-dev libssl-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
zlib1g-dev is already the newest version.
libssl-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 180 not upgraded.

any idea ? my OS info :

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:   trusty

I installed this version of ruby :

# ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]


answered 3 months ago Freeman #1

Thanks to all of you, My problem solved via this:

aptitude purge ruby

I hope you will find this command useful.

comments powered by Disqus