root@localhost rubygems-1.3.6]# /usr/local/ruby/bin/gem install rails -v=2.3.4
/usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- zlib (LoadError)
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/package.rb:10
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/format.rb:9
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/installer.rb:10
  ... 11 levels...
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:133:in `process_args'
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:104:in `run'
 from /usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
 from /usr/local/ruby/bin/gem:21
 
 
 
 
 
 
解决方法:
1. yum install -y zlib zlib-devel
2.进入ruby的解压目录,到ext/zlib下,执行命令:ruby extconf.rb
3.make;make install
4.ok了