views:

32

answers:

3

Hi, I am new to rails . i am trying to install gems from the source . I AM HAVING ClothRed-0.4.1.gem file . How can i install this gem manually . This .gem file had data.tar.gz and metadata.gz file ..

+1  A: 

cd into the directory with ClothRed-0.4.1.gem

sudo gem install ClothRed-0.4.1.gem
Mike Williamson
A: 

First off if you installed rubygems through apt I would remove it and rebuild it from source; the version that's in the 9.04 repo is pretty old.

apt-get remove rubygems
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
tar -zxvf rubygems-1.3.7.tgz
cd rubygems-1.3.7.tgz
ruby setup.rb

Now follow the steps Mike gave you and you should be ready to rock.

Maran
A: 

I know you say you want to install gems from source and all that fun stuff, but I would highly recommend (if you are starting out especially) to go through the following and start using rvm, as it indirectly helps you keep your gems organized.

$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

and

rvm install 1.9.2 -C --with-readline-dir=/opt/local,--build=x86_64-apple-darwin10

(presuming you are setting up all your localhost etc on a MacPro) - still not met a windows RoR guy yet ;)

then

rvm use --create 1.9.2@rails3

for good measure you could do this:

$ gem install sqlite3-ruby
$ env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
$ gem install rails

then if you like

rvm 1.9.2@rails3 --default

Phewww after all that, when you now install gems they are related to a ruby build.See rvm docs for more info.

To test this has worked and you can now manage all your gems nicely:

try

gem list

then

rvm system

to revert to what you had

then

rvm 1.9.2@rails3

then

gem list

This is a nice way to keep your gems organized.

Sorry for turning this into a RVM answer, but if you use more than 1 machine rvm helps you stay sane ;)

PS: Saves cd'ing into dir with sudo etc etc like Mike suggested...that's not needed if you do it this way.

dryprogrammers