I got around to setting up Ruby on our new Centos 5 server today and ran into a snag. I ran:
And went on to installing rubygems. However in installing rubygems I got an error that rdoc was not installed. Now I don’t remember ever having to install RDoc on my mac so I did a quick google search. Seems that RDoc is part of the standard ruby install but my package didnt have it. So I uninstalled my my rpm and went on about compiling from source. However when I went to install rubygems this time I got an error about zlib. After another quick google search I realized that I had not installed the other ruby packages. So I killed my compiled source for ruby and reinstalled from rpms this time running
yum install -y ruby
yum install -y ruby-devel ruby-docs ruby-ri ruby-irb ruby-rdoc
Then my rubygems package installed correctly and I am on my way.
19 Responses to “Installing Ruby and RubyGems on Centos 5”
Trackbacks/Pingbacks
- Alexei@Nitobi » Blog Archive » Easy Ruby and RubyGems install on CentOS 5 - [...] http://blog.simb.net/2007/08/21/installing-ruby-and-rubygems-on-centos-5/ [...]

Thanks! This saved me a ton of time!
Glad you found it helpful nick.
I’ve installed the ruby packages (including the extra ones you mentioned, thanks for that), but still get the following error when trying in install rubygems from the automated install script:
“./setup.rb: line 271: syntax error: unexpected end of file”
Suggestions?
Thanks!
G
ohhh – nevermind.
Found it in the rubygems docs;
it’s
>ruby ./setup.rb
duh.
Extremely helpful, thanks a million. Worked like a charm.
Thank you… As nick said, saved me a ton of time..
too old version (:
now i using ruby ee (rubyenterpriseedition.com)
hi my problem is very dificultd i do not write the english much, good my problem is this: Excluding Packages in global exclude list
after keying the following thing:
yum install -y ruby
yum install -y ruby-devel ruby-docs ruby-ri ruby-irb ruby-rdoc
and that is my problem somebody can help me?
Same here. Thanks very much!!
This the absolute best post I have found in over 15 years of searching for solutions on the Internet, Thanks a million Simeon!
very helpful . thanks
Thank you a lot. I got the same issue here and your tip solved it.
Could I install a newer version of ruby? by yum or any other way?
Hey.. This is super cool.. I was looking for an installation of sup email client and it required ruby gems.. It made me qutie skeptical in the sense, there is always a problem of dependencies and compatibility when it comes to CentOS, On Ubuntu, sup installed right away…
On CentOs, I have to have rubygems and probably this is by far the post which gave me all the right things about installations and everything worked one shot.!!!
Marking it in my reader
Cheers!
shyam
saved me a bunch of time. perfect post – thanks!
Thx a lot.
Thanks Alot !!
WARNING! This was good post when it was written, but it’s now outdated. This will only install Ruby 1.8.5.
I found this post helpful for installing ruby 1.9+gems:
http://www.freshblurbs.com/install-ruby-1-9-centos
Old shit