Reputation: 1671
I read a similar post but I am not using ubuntu, and do not have apt-get.
fyi, uname: x86_64 x86_64 x86_64 GNU/Linux
When attempting to do "gem install rails", I get
[root@domU-12-31-39-07-7D-C1 ruby-1.9.2-p136]# gem install rails
ERROR: Loading command: install (LoadError)
no such file to load -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand
However, when I do "yum install zlib", it says that is installed.
[root@domU-12-31-39-07-7D-C1 ruby-1.9.2-p136]# yum install zlib
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Package zlib-1.2.3-24.6.amzn1.x86_64 already installed and latest version
Nothing to do
I tryed which zlib
and have confirmed it doesn't exist. Any tips?
Thanks.
Upvotes: 1
Views: 3189
Reputation: 21
I fixed this error through search.
http://ubuntuforums.org/showthread.php?t=1494997#post11359766
sudo apt-get install zlib1g-dev
cd /ruby-source-files/ext/zlib
#rvm ~/.rvm/src/ruby-*.*.*/ext/zlib
ruby extconf.rb
make
sudo make install
Upvotes: 0
Reputation: 13964
I ran into this problem the other day, and my solution was: "switch to REE"... which correctly installed gems
Upvotes: 0
Reputation: 1671
Yes! I found an answer here: http://lucaschan.com/weblog/2007/03/22/installing-ruby-on-rails-on-centosredhat-4x/
I only needed a subset of his instructions which was to go into the source and:
cd ruby-1.9.2-p136/ext/zlib/
ruby extconf.rb --with-zlib-include=/usr/include --width-zlib-lib=/usr/lib
gem install rails --include-dependencies
That's it! Thanks to Lucas;)
Upvotes: 3