Installing Rubygems on Centos4.3-32

I'm trying to install Ruby and Rubygems on a dedicated server.
I installed ruby through "yum install ruby" after doing "yum update".

Now when I try to install Rubygems 1.3, I get the following error when doing ruby setup.rb:
./lib/rubygems.rb:713:in `set_paths': uninitialized constant Gem::Etc (NameError)
        from ./lib/rubygems.rb:711:in `each'
        from ./lib/rubygems.rb:711:in `set_paths'
        from ./lib/rubygems.rb:518:in `path'
        from ./lib/rubygems/source_index.rb:66:in `installed_spec_directories'
        from ./lib/rubygems/source_index.rb:56:in `from_installed_gems'
        from ./lib/rubygems.rb:726:in `source_index'
        from ./lib/rubygems/gem_path_searcher.rb:86:in `init_gemspecs'
        from ./lib/rubygems/gem_path_searcher.rb:21:in `initialize'
        from ./lib/rubygems.rb:676:in `new'
        from ./lib/rubygems.rb:676:in `searcher'
        from ./lib/rubygems.rb:675:in `synchronize'
        from ./lib/rubygems.rb:675:in `searcher'
        from ./lib/rubygems/custom_require.rb:30:in `require'
        from /usr/lib/ruby/1.8/tmpdir.rb:12
        from ./lib/rubygems/custom_require.rb:27:in `gem_original_require'
        from ./lib/rubygems/custom_require.rb:27:in `require'
        from setup.rb:95

Additionally, I noticed that when doing ruby -v,  the ruby version is 1.8.1 (2003-12-25) [i386-linux-gnu]

If it's impossible to fix this, instructions to manually compile ruby are welcome as well.
Who is Participating?
Michael WorshamConnect With a Mentor Infrastructure / Solutions ArchitectCommented:
You might have to subscribe to testing repository from CentOS...
Michael WorshamInfrastructure / Solutions ArchitectCommented:
This article is geared to CentOS 5, but should work for you as well:

GertoWSAuthor Commented:
Thanks, but I already tries this, still gives me an older version of ruby
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Michael WorshamInfrastructure / Solutions ArchitectCommented:
Cut/paste an output of 'rpm -qa | grep ruby*' so we can get an idea of what you have already installed.
GertoWSAuthor Commented:
Michael WorshamInfrastructure / Solutions ArchitectCommented:
GertoWSAuthor Commented:
Setting up Install Process
Setting up repositories [Errno 4] IOError: <urlopen error (113, 'No route to host')>
Trying other mirror.
update                    100% |=========================|  951 B    00:00 [Errno 4] IOError: <urlopen error (113, 'No route to host')>
Trying other mirror.
base                      100% |=========================| 1.1 kB    00:00
addons                    100% |=========================|  951 B    00:00
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
Excluding Packages in global exclude list
Parsing package install arguments
No Match for argument: rubygems
Nothing to do
GertoWSAuthor Commented:
Funny, I just found information that was about the same on this link:
After doing this:

and then twice
yum install -y ruby-devel ruby-docs ruby-ri ruby-irb ruby-rdoc

after that I had ruby 1.8.5 (not  completely up to date but better) and managed to install ruby.

Now I still need to find a way to get the latest version of ruby, but that is out of the scope of this question I guess.

Your replies helped me in the right direction, thanks!
GertoWSAuthor Commented:
Thanks for the help!
Michael WorshamInfrastructure / Solutions ArchitectCommented:
I tried using the instructions from the same link under CentOS 5 and it worked like a charm.

Glad I could help point you in the right direction.

-- Michael
Michael WorshamInfrastructure / Solutions ArchitectCommented:
After using the steps above from that 'blog' post...

To upgrade to RubyGems 1.3, try doing this:

gem install rubygems-update

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.