How to find and install rubygems on Cygwin

  • Thread starter Peter Vanderhaden
  • Start date
P

Peter Vanderhaden

I'm a newbie as far as Ruby goes, and I want to install rubygems in
Cygwin. I have Ruby installed, but I don't know what I need to install
gems. This message shows that it can't find, or I don't have the files
needed:
$ gem install -r net-ssh
/cygdrive/c/ruby/bin/gem:9:in `require': no such file to load --
rubygems (LoadE
rror)
from /cygdrive/c/ruby/bin/gem:9

Can anyone tell me what I need to download, and where I can it?
Thanks in advance....
 
S

Stefano Crocco

Alle luned=C3=AC 3 settembre 2007, Peter Vanderhaden ha scritto:
I'm a newbie as far as Ruby goes, and I want to install rubygems in
Cygwin. I have Ruby installed, but I don't know what I need to install
gems. This message shows that it can't find, or I don't have the files
needed:
$ gem install -r net-ssh
/cygdrive/c/ruby/bin/gem:9:in `require': no such file to load --
rubygems (LoadE
rror)
from /cygdrive/c/ruby/bin/gem:9

Can anyone tell me what I need to download, and where I can it?
Thanks in advance....

I don't use Cygwin (or windows), so my instructions may be inaccurate. gem =
is=20
a command provided by rubygems, so you can't use it to install rubygems=20
itself. To do this, instead, you should go to the rubygems project page on=
=20
rubyforge (http://rubyforge.org/projects/rubygems/) and download it. After=
=20
following the 'download' link, you'll be able to choose between a gzip and=
a=20
zip file (the other file, rubygems-update-0.9.4.gem can only be used if you=
=20
already have rubygems installed). After downloading the file, uncompress it=
,=20
cd into the directory you just created and issue the command=20

ruby setup.rb

This should be enough to install it.

I hope this helps

Stefano
 
D

Dan Zwell

Peter said:
I'm a newbie as far as Ruby goes, and I want to install rubygems in
Cygwin. I have Ruby installed, but I don't know what I need to install
gems. This message shows that it can't find, or I don't have the files
needed:
$ gem install -r net-ssh
/cygdrive/c/ruby/bin/gem:9:in `require': no such file to load --
rubygems (LoadE
rror)
from /cygdrive/c/ruby/bin/gem:9

Can anyone tell me what I need to download, and where I can it?
Thanks in advance....

I think you need to change the path where rubygems searches for
libraries. You obviously have the "gem" executable, but gem is running
"require 'rubygems'", which is failing. You should find rubygems.rb and
note its folder. Say it's in /cygdrive/c/ruby/lib/, for example. You can
start ruby with that information: ruby -I /cygdrive/c/ruby/lib/. It is
up to you whether to type that manually each time you need to (i.e.,
ruby -I /cygdrive/c/ruby/lib/ /cygdrive/c/ruby/bin/gem install -r
something), or write a wrapper script that calls the ruby executable
with that argument. The second solution will work for any invocation of
ruby, while you can obviously only utilize the first solution if ruby
starts because you typed "ruby" on the command line (might as well use
an alias, if that's the case).

But it seems like this shouldn't be a problem... are there any better
ways to install ruby on cygwin? (I haven't used cygwin in years...)

Dan
 
P

Peter Vanderhaden

Stefano,
I tried your directions and everything now works thank you very much!
Thanks also to everyone who responded. Hopefully I'll be able to help
you all out someday.
Peter V.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
SterlingLa
Top