0
votes

Am trying to install Ruby and RubyGems on a RedHat 5.5 machine. I'd got them by running the following two commands:

sudo yum install ruby
sudo yum install rubygems

Got both installed. However when i try to run gem, i got the following error:

/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require': undefined methodend_with?' for "no such file to load -- Win32API":String (NoMethodError) from /usr/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:55 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire' from /usr/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:8 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:inrequire' from /usr/bin/gem:9

Doesn't matter what kind of command i run, it throws that. (I tried gem -v, gem update)

The version of Ruby seems to be 1.8 but i have problem determining the RubyGems version. I'd vi into rubygems.rb and at the top it stats the version as 1.5.

Try to fix by running the downgrade command as proposed here, but it throws the same error as well.

Any help on fixing this issue? Just want to get this running so that i can run a RoR apps..

2
If you are in a hurry, any chance with RVM or rbenv? And YUM should give you information about the package versions. Note that Rails has got some constraints on the Ruby version to run on.Eric Platon
the server doesn't have RVM or rbenv. i'm a bit confused with the relationship; between Ruby and RVM or rbenv though. Those 2 can intall Ruby on the server right? But then they do not depends on Ruby itself?ipohfly
RVM and rbenv are Ruby installers. They do not rely on Ruby (e.g. RVM is a set of shell scripts). The point is that they allow you to choose the Ruby version you want to install. Please check the version you need for Rails at the aforementioned link. Recent version of Rails have dropped Ruby versions up to 1.9.3, etc.Eric Platon

2 Answers

1
votes

RedHat 5 ships with Ruby 1.8.5 and an equally old rubygems. Both, the rubygems and the ruby version is WAY too old to be supported by anything outside the base packages of the OS anymore. Even in the OS packages, they probably won't change anything on their own due to the age of their whole system.

If you really want/have to use Ruby on Red Hat 5, you probably need to get another source for it that the RPMs provided by the OS, e.g. rbenv / ruby-build or ruby-install or even rvm. You should use a newer Ruby version, i.e. a 2.1 or 2.2 version. All Ruby versions < 2.0 are unsupported by the language developers by now.

Alternatively, you should try to use a newer version of RedHat, i.e. RedHat 7 which doesn't need to support to 8 year old software...

0
votes

Suspicious here is that yum installed ruby 1.8 which is pretty outdated version, it seems you have two versions of ruby on your system now and gem tries to use the old one.

Check the version of the package installed recently and try to force rubygems to use the new version(by removing the old ruby or linking to the path returned by which ruby)