Could not find gem rack locally or in a repository

I was trying to install Ruby on Rails Gem and it is failed with error of “could not find gem rack locally or in a repository”.

–Error–
===================
root@mickgenie.com [~]# gem install rack
ERROR:  could not find gem rack locally or in a repository
===================

I did try to overcome the issue and found out there are two solutions for it.

Solution 1:
Change the gem source.

To show the gem source installed in the server,
===================
root@mickgenie.com [~]# gem source
*** CURRENT SOURCES ***

http://gems.rubyforge.org/
===================

1. Change the gem source to allow http://rubygems.org/.
===================
root@mickgenie.com [~]# gem sources -a http://rubygems.org/
http://rubygems.org/ added to sources

===================
2. Check the gem source again and it is added.
3. Install your gem again.
===================
root@mickgenie.com [~]# gem install rack
===================

Solution 2:
Download the Gem source to your server and install it locally and let say I am referring to rack gems.

Download the source file from URL below.
http://rack.rubyforge.org/

===================
root@mickgenie.com [~]# wget http://rubyforge.org/frs/download.php/71197/rack-1.2.0.tar.gz
root@mickgenie.com [~]# tar zxf rack-1.2.0.tar.gz
root@mickgenie.com [~]# gem install rack

===================

Published by

Mick Genie

Mick Genie is the founder of MickGenie.com and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.

2 thoughts on “Could not find gem rack locally or in a repository”

Comments are closed.