Error installing gems: cannot load such file -- zlib
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 anyone else who runs into it. cannot load such file -- zlib even after using rvm pkg install zlib
I ended up installing zlib from apt-get and then reinstalling ruby to not use the rvm directory for zlib.
Here's how do:
$ sudo apt-get install zlib1g-dev
$ rvm reinstall 1.9.3
[Edit] As commenter @chrisfinne mentions, on CentOS/RedHat based systems:$ sudo yum install zlib-devel
$ rvm reinstall 1.9.3
Error in ruby: cannot load such file -- zlib
You should not install readline
/ zlib
on ubuntu, follow this steps:
rvm get head
rvm pkg remove
rvm requirements run force
rvm reinstall 1.9.3-p374
make sure to include output of the installation process if this fails, also include all mentioned log files How to fix zlib error in ruby?
Thanks to all of you, My problem solved via this:
aptitude purge ruby
I hope you will find this command useful.
Related Topics
Deleting Items from an Array Requires Multiple Passes to Remove Them All
How to Deploy a Threadsafe Asynchronous Rails App
Difference Between @@ and @ in Ruby
Automating Ssh to Windows with Ruby
How to Specify Regexp Options Using Regexp.Union
Using Google Search Rest API in Ruby
How to Unescape C-Style Escape Sequences from Ruby
Get All Products of Category and Child Categories (Rails, Awesome_Nested_Set)
How to Use Strong Parameters with an Objects Array in Rails
Ruby Require 'File' Doesn't Work But Require './File' Does. Why
How to Use Omniauth to Make Authenticated Calls to Services
Using Multiple Yields to Insert Content
Ruby on Rails: Pluralize for Other Languages
Rails 3.1 Has_One Nested Resource: Routing Not Generating "All" Paths