rvm, zlib and ruby not working even after following instructions
please use the "quick fix" from here https://rvm.io/packages/zlib/
you have to ignore the rest of instructions, they are intended for systems that do not support packages (like osx)
Not able to run gem command and build ruby with zlib support
RVM causes more problems than it solves (IMHO). Better tools are ruby-build and rb-env. Newer tools that look very good too are ruby-install and chruby.
Here are my notes from my recent Red Hat Enterprise Linux (RHEL) installation of Ruby, which I believe is pretty similar to Fedora. Perhaps these notes can be of some help to you. Ask me questions if you like.
Install zlib
yum install zlib zlib-devel
Install YAML
export k=yaml v=0.1.4
wget http://pyyaml.org/download/libyaml/$k-$v.tar.gz
tar zxvf $k-$v.tar.gz
cd $k-$v
./configure
make && make install
Install X11 if you want X or headless browsing for testing
yum install
xorg-x11-fonts-misc
xorg-x11-fonts-truetype
xorg-x11-server-Xorg
xorg-x11-server-Xvfb
Install libraries
yum install
gdbm gdbm-devel
ncurses ncurses-devel
openssl openssl-devel
readline readline-devel
tk tk-devel
libjpeg libjpeg-devel
libpng libpng-devel
libxml2 libxml2-devel
libxslt libxslt-devel
zlib zlib-devel
Install ruby-build
cd /opt
git clone git://github.com/sstephenson/ruby-build.git
cd ruby-build/
./install.sh
Install Ruby
export k=ruby v=1.9.3-p125
wget http://ftp.ruby-lang.org/pub/ruby/1.9/$k-$v.tar.gz
tar zxvf $k-$v.tar.gz
cd $k-$v
# Either onfigure with defaults...
./configure
# Or configure with custom locations...
./configure --prefix=/opt/$k/$v --enable-shared --with-opt-dir=/opt/yaml/current
make && make check && make install
Environment
Edit /etc/environment to add this:
RUBYOPT='-r rubygems -r psych'
If you put Ruby in a custom directory, also merge this with your existing path:
PATH=/opt/ruby/1.9.3-p125/bin (or wherever you put it)
Load environment:
source /etc/environment
Verify gem runs and you see the intial set of gems:
gem list
Gem update:
gem update --system
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
Ubuntu rails install fails on zlib
If you come across this question trying to install Ruby using Ruby Version Manager (RVM) on Ubuntu 10.04 then there are instructions on installing zlib on the rvm web site http://rvm.beginrescueend.com/packages/zlib/
The steps are:
rvm pkg install zlib
(or
if you get "ERROR: Unrecognized command line argument: 'pkg'" - older versions of rvm used the verb 'package' instead)
rvm package install zlib
then
rvm remove 1.9.1
rvm install 1.9.1
Issue in install rvm on ubuntu
One library is missing. Try executing this first:
sudo apt-get install zlib1g-dev
EDIT:
In the rvm webpage there's a section about this issue https://rvm.io/packages/zlib/
EDIT(mpapis):
The installer command was showing short screen with instruction to install this library, next time read it before pressing q
.
Related Topics
How to Use Bundler with Offline .Gem File
How to Alter the Timezone of a Datetime in Ruby
How to Find the Namespace/Module Name Programmatically in Ruby on Rails
Ruby Sleep or Delay Less Than a Second
How to Require Active Record Working Outside of Rails
How to Convert a Ruby Hash So That All of Its Keys Are Symbols
How to Use Hash Keys as Methods on a Class
Ruby: How to Convert a String to Boolean
How to Add Migration with Multiple References to the Same Model in One Table? Ruby/Rails
Simple Way of Turning Off Observers During Rake Task
Differencebetween Integer and Fixnum
Spinning Background Tasks in Rails
Fail to Bundle Install Puma 4.3.5 or Gem Puma with Ruby-2.6.6 on MACos-10.15.6
How to Get Readline Support in Irb Using Rvm on Ubuntu 11.10