I have installed CentOS 5.2 on my PC. Ruby 1.8.5 and Ruby-devel
packages are already installed. I have downloaded rubygems-1.3.1.tgz
package and installed it. Now I am trying to install Rails by the
command below:
gem install rails
But it gives me the following error:
ERROR: While executing gem … (Zlib::DataError)
incorrect header check
zlib and zlib-devel are already installed on my pc. I can install
other gems like hpricot etc. But still I cannot install rails.
Can somebody please guide me how can I install rails on CentOS?
These MAY not be needed. Come back and do them if things don’t go
right in install ruby gems and rails.
1a) zlib support
cd ruby-1.8.6
ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/
lib
make
sudo make install
1b) openssl
cd ruby-1.8.6/ext/openssl
ruby extconf.rb
make
sudo make install
install various other things that came up!
sudo yum install -y fedora-rpmdevtools – not found/needed
sudo yum install -y openssl-devel
sudo yum install -y zlib zlib-devel
sudo yum install -y libjpeg-devel libpng-devel glib2-devel fontconfig-
devel zlib-devel libwmf-devel freetype-devel libtiff-devel
sudo yum install -y cabextract – not found
sudo yum install -y pcre-devel
sudo yum install -y subversion
sudo yum install -y readline-devel
Create a file in $HOME called .rpmmacros with the following line in it
%_topdir %(echo $HOME)/rpmbuild
create the directories $HOME/rpmbuild/BUILD and $HOME/rpmbuild/RPMS/
noarch
And then followed the steps you have mentioned. But when I run command
to install rails first it try to update rubygems. It was taking very
long time. So I have updated rubygems by the following command:
gem update --system
After gem is successfully updated, I tried again to install rails. But
it was giving the same error again:
ERROR: While executing gem … (Zlib::DataError)
incorrect header check