Problem installing ruby rails on CentOS 5.5

I try to install ruby on rails using a repository CentOS 5.5 rubyworks:

[rubyworks]
name=RubyWorks
baseurl=http://rubyworks.rubyforge.org/redhat/$releasever/RPMS/$basearch
enabled=1
gpgcheck=1
gpgkey=http://rubyworks.rubyforge.org/RubyWorks.GPG.key
priority=1

I using yum to install ruby and rubygems

# yum install ruby ruby-devel ruby-libs ruby-irb ruby-rdoc ruby-mysql rubygems

And I need to install rails using gem

# gem install rails

But I had the following error that can’t solve :(

# gem install rails –source http://gems.opscode.com
Updating metadata for 59 gems from http://gems.opscode.com
…………………………………………………..
complete
ERROR:  could not find rails locally or in a repository
# gem source -a http://gems.opscode.com
Updating metadata for 59 gems from http://gems.opscode.com
…………………………………………………..
complete
Updating metadata for 11 gems from http://rubyworks.rubyforge.org/redhat/5/GEMS/x86_64/
………..
complete
http://gems.opscode.com added to sources
# gem install rails
Updating metadata for 11 gems from http://rubyworks.rubyforge.org/redhat/5/GEMS/x86_64/
………..
complete
Updating metadata for 59 gems from http://gems.opscode.com
…………………………………………………..
complete
ERROR:  could not find rails locally or in a repository
# gem update –system
Updating RubyGems…
Updating metadata for 11 gems from http://rubyworks.rubyforge.org/redhat/5/GEMS/x86_64/
………..
complete
Updating metadata for 59 gems from http://gems.opscode.com
…………………………………………………..
complete
Attempting remote update of rubygems-update
ERROR:  could not find rubygems-update locally or in a repository
ERROR:  While executing gem … (NoMethodError)
undefined method `version’ for nil:NilClass
# gem –source http://gems.github.com
ERROR:  Invalid option: –source.  See ‘gem –help’.
# gem –source http://gemcutter.org/
ERROR:  Invalid option: –source.  See ‘gem –help’.
# gem source -a http://gemcutter.org/
ERROR:  While executing gem … (Gem::RemoteSourceException)
HTTP Response 302 fetching http://gemcutter.org/yaml
# gem source -a http://gems.github.com
Bulk updating Gem source index for: http://gems.github.com
Updating metadata for 11 gems from http://rubyworks.rubyforge.org/redhat/5/GEMS/x86_64/
………..
complete
Updating metadata for 59 gems from http://gems.opscode.com
…………………………………………………..
complete
http://gems.github.com added to sources
# gem install rails
Updating metadata for 11 gems from http://rubyworks.rubyforge.org/redhat/5/GEMS/x86_64/
………..
complete
Updating metadata for 59 gems from http://gems.opscode.com
…………………………………………………..
complete
Bulk updating Gem source index for: http://gems.github.com
ERROR:  could not find rails locally or in a repository

search results suggest to reinstall rubygems from source:

# wget wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz

# tar -zxvf rubygems-1.3.7.tgz

# cd rubygems-1.3.7

# ruby setup.rb

# gem update –system

# update_rubygems

# gem sources -a http://gems.opscode.com
# gem sources -a http://rubygems.org

# gem update –system

# gem install rails

And I still get the following error message:

ERROR:  could not find gem rails locally or in a repository

How can fix it?

Leave a Reply

Your email address will not be published. Required fields are marked *


*