[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Help with Ruby under cygwin

James Byrne

6/12/2008 2:32:00 PM

In order to use git on my laptop (MS XPproSP3) I ended up installing the
cygwin environment. I tried MSysGit but it failed to run and the
maintainer was, shall we say, less than enthusiastic with my bug report.

Now, everything works from the standard windows dos box. However, when
I try and run a ruby utility such as gem, rake or rails from within the
cygwin bash shell window then each gives the same style of error:

$ which rails
/cygdrive/c/usr/lib/ruby/bin/rails
$ rails
c:\usr\lib\ruby\bin\ruby.exe: No such file or directory --
/cygdrive/c/usr/lib/r
uby/bin/rails (LoadError)
$
$ which gem
/cygdrive/c/usr/lib/ruby/bin/gem
$ gem list
c:\usr\lib\ruby\bin\ruby.exe: No such file or directory --
/cygdrive/c/usr/lib/r
uby/bin/gem (LoadError)
$
$ which rake
/cygdrive/c/usr/lib/ruby/bin/rake
$ rake
c:\usr\lib\ruby\bin\ruby.exe: No such file or directory --
/cygdrive/c/usr/lib/r
uby/bin/rake (LoadError)

I am not having this problem with anything else and so I am first asking
for help here since I expect the cygwin people will turn me to this
forum in the end in any case.

Any insight anyone can provide me as to what is going on here would be
most appreciated.
--
Posted via http://www.ruby-....

26 Answers

Robert Klemme

6/12/2008 2:57:00 PM

0

2008/6/12 James Byrne <byrnejb@harte-lyne.ca>:
> In order to use git on my laptop (MS XPproSP3) I ended up installing the
> cygwin environment. I tried MSysGit but it failed to run and the
> maintainer was, shall we say, less than enthusiastic with my bug report.
>
> Now, everything works from the standard windows dos box. However, when
> I try and run a ruby utility such as gem, rake or rails from within the
> cygwin bash shell window then each gives the same style of error:
>
> $ which rails
> /cygdrive/c/usr/lib/ruby/bin/rails
> $ rails
> c:\usr\lib\ruby\bin\ruby.exe: No such file or directory --
> /cygdrive/c/usr/lib/r
> uby/bin/rails (LoadError)
> $
> $ which gem
> /cygdrive/c/usr/lib/ruby/bin/gem
> $ gem list
> c:\usr\lib\ruby\bin\ruby.exe: No such file or directory --
> /cygdrive/c/usr/lib/r
> uby/bin/gem (LoadError)
> $
> $ which rake
> /cygdrive/c/usr/lib/ruby/bin/rake
> $ rake
> c:\usr\lib\ruby\bin\ruby.exe: No such file or directory --
> /cygdrive/c/usr/lib/r
> uby/bin/rake (LoadError)
>
> I am not having this problem with anything else and so I am first asking
> for help here since I expect the cygwin people will turn me to this
> forum in the end in any case.

Hm, the path to your ruby.exe looks suspicious. What's the output of
"type -a" at a bash prompt? For me it's this:

16:55:17 ~$ type -a ruby
ruby is /usr/bin/ruby
ruby is /bin/ruby
ruby is /usr/bin/ruby

Also, what does echo "$PATH" output? Maybe you are pulling the wrong Ruby.

Did you use the Ruby package that comes with cygwin or did you install
from sources?

Kind regards

robert


--
use.inject do |as, often| as.you_can - without end

M. Edward (Ed) Borasky

6/12/2008 2:58:00 PM

0

James Byrne wrote:
> In order to use git on my laptop (MS XPproSP3) I ended up installing the
> cygwin environment. I tried MSysGit but it failed to run and the
> maintainer was, shall we say, less than enthusiastic with my bug report.
>
> Now, everything works from the standard windows dos box. However, when
> I try and run a ruby utility such as gem, rake or rails from within the
> cygwin bash shell window then each gives the same style of error:
>
> $ which rails
> /cygdrive/c/usr/lib/ruby/bin/rails
> $ rails
> c:\usr\lib\ruby\bin\ruby.exe: No such file or directory --
> /cygdrive/c/usr/lib/r
> uby/bin/rails (LoadError)
> $
> $ which gem
> /cygdrive/c/usr/lib/ruby/bin/gem
> $ gem list
> c:\usr\lib\ruby\bin\ruby.exe: No such file or directory --
> /cygdrive/c/usr/lib/r
> uby/bin/gem (LoadError)
> $
> $ which rake
> /cygdrive/c/usr/lib/ruby/bin/rake
> $ rake
> c:\usr\lib\ruby\bin\ruby.exe: No such file or directory --
> /cygdrive/c/usr/lib/r
> uby/bin/rake (LoadError)
>
> I am not having this problem with anything else and so I am first asking
> for help here since I expect the cygwin people will turn me to this
> forum in the end in any case.
>
> Any insight anyone can provide me as to what is going on here would be
> most appreciated.

I'm not on my Cygwin system at the moment; I can check it later today
and give you a definitive answer. But it looks like your paths aren't
right. The Ruby executable itself in a Cygwin prompt should show up as
/usr/bin/ruby. If you type 'which ruby' from the prompt that's what you
should see. And the libraries should be in /usr/lib/ruby/... .

What I would recommend is uninstalling everything and reinstalling
rubygems from source. Then reinstall rails and its dependencies with
"gem install".


James Byrne

6/12/2008 3:29:00 PM

0

Thanks.

Yes, I have a previous windows only install of ruby and gem. I will
remove that and use the cygwin version and see how things shake out
after that.
--
Posted via http://www.ruby-....

ThoML

6/12/2008 3:41:00 PM

0

> In order to use git on my laptop (MS XPproSP3) I ended up installing the
> cygwin environment. I tried MSysGit but it failed to run and the
> maintainer was, shall we say, less than enthusiastic with my bug report.

I'm not sure if I understand. MSysGIT sounds like it would be
something from msys (ie. mingw). Why would you want to run a mingw git
from cygwin that has its own git?

cygwin has different path conventions that mingw or win32. I'd suggest
to run rxvt & bash.

It also seems slightly less than 100% optimal that you installed the
cygwin stuff to c:. IIRC the installer suggests c:\cygwin.

James Byrne

6/12/2008 4:48:00 PM

0

I removed the windows install of ruby and all the gems. I then
installed ruby from cygwin. I then downloaded rubygems-1.1.1.tgz from
rubyforge. I checked that the the path variables were correctly set and
that the same ruby executable was accessed from both the native cmd
window and the cygwin shell.

$ which ruby
/usr/bin/ruby

and

C:\DATA\DOWNLOAD\SOFTWARE\>which ruby
/usr/bin/ruby


I then expanded the tarball and made that directory the pwd. When I run
ruby setup.rb, in either the cmd window or the cygwin bash shell I see
this error:

BASH SHELL
byrnejb@HAL-M13
/cygdrive/c/DATA/DOWNLOAD/SOFTWARE/org.rubyforge/rubygems/rubyge
ms-1.1.1
$ ruby setup.rb
ruby: no such file to load -- ubygems (LoadError)

CMD WINDOWS SHELL
C:\DATA\DOWNLOAD\SOFTWARE\org.rubyforge\rubygems\rubygems-1.1.1>ruby
setup.rb
ruby: no such file to load -- ubygems (LoadError)

Any ideas as to what is going on?

--
Posted via http://www.ruby-....

James Byrne

6/12/2008 4:58:00 PM

0

ThoML wrote:
>> In order to use git on my laptop (MS XPproSP3) I ended up installing the
>> cygwin environment. I tried MSysGit but it failed to run and the
>> maintainer was, shall we say, less than enthusiastic with my bug report.
>
> I'm not sure if I understand. MSysGIT sounds like it would be
> something from msys (ie. mingw). Why would you want to run a mingw git
> from cygwin that has its own git?

I only installed the cygwin environment when it became obvious that the
MsysGiT maintainers were not interested in looking at my problem in the
near term, if ever. So the order of events was:

Ruby on Windows => OK,
Gem on Windows => OK,
MSysGiT on Windows => FAIL,
cygwin with GiT => OK,
Gem on Windows => FAIL

>
> It also seems slightly less than 100% optimal that you installed the
> cygwin stuff to c:. IIRC the installer suggests c:\cygwin.

cygwin is installed in C:\cygwin

--
Posted via http://www.ruby-....

Ehrick, Robert O

6/12/2008 5:07:00 PM

0

Under a cygwin term, I had to 1st set:

RUBYOPT=;export RUBYOPT

before installing rubygems with

$ ruby setup.rb

[Some installation output:

ruby setup.rb
install -c -m 0644 rbconfig/datadir.rb
/usr/local/lib/ruby/site_ruby/1.8/rbconfi
g/datadir.rb
mkdir -p /usr/local/lib/ruby/site_ruby/1.8/rubygems
install -c -m 0644 rubygems/builder.rb
/usr/local/lib/ruby/site_ruby/1.8/rubygem
s/builder.rb
install -c -m 0644 rubygems/command.rb
/usr/local/lib/ruby/site_ruby/1.8/rubygem
s/command.rb
.... (MANY MORE LINES)

]

Best to you,
Bob

-----Original Message-----
From: byrnejb@harte-lyne.ca [mailto:byrnejb@harte-lyne.ca]
Sent: Thursday, June 12, 2008 11:48 AM
To: ruby-talk ML
Subject: Re: Help with Ruby under cygwin

I removed the windows install of ruby and all the gems. I then
installed ruby from cygwin. I then downloaded rubygems-1.1.1.tgz from
rubyforge. I checked that the the path variables were correctly set and
that the same ruby executable was accessed from both the native cmd
window and the cygwin shell.

$ which ruby
/usr/bin/ruby

and

C:\DATA\DOWNLOAD\SOFTWARE\>which ruby
/usr/bin/ruby


I then expanded the tarball and made that directory the pwd. When I run

ruby setup.rb, in either the cmd window or the cygwin bash shell I see
this error:

BASH SHELL
byrnejb@HAL-M13
/cygdrive/c/DATA/DOWNLOAD/SOFTWARE/org.rubyforge/rubygems/rubyge
ms-1.1.1
$ ruby setup.rb
ruby: no such file to load -- ubygems (LoadError)

CMD WINDOWS SHELL
C:\DATA\DOWNLOAD\SOFTWARE\org.rubyforge\rubygems\rubygems-1.1.1>ruby
setup.rb
ruby: no such file to load -- ubygems (LoadError)

Any ideas as to what is going on?

--
Posted via http://www.ruby-....


James Byrne

6/12/2008 5:18:00 PM

0

Ehrick, Robert O wrote:
> Under a cygwin term, I had to 1st set:
>
> RUBYOPT=;export RUBYOPT
>
> before installing rubygems with
>
> $ ruby setup.rb

> Best to you,
> Bob

Those were the magic words. Many thanks.
--
Posted via http://www.ruby-....

ThoML

6/12/2008 5:29:00 PM

0

> cygwin is installed in C:\cygwin

It didn't show up in your output which is why I suspected that you
mixed cygwin and non-cygwin apps which can cause troubles.

Peter Pk

8/18/2008 4:34:00 PM

0

Robert Klemme wrote:
>> I am not having this problem with anything else and so I am first asking
>> for help here since I expect the cygwin people will turn me to this
>> forum in the end in any case.

I guess I will ask myself - this is long but complete :)

If this is the wrong place to post this let me know.
I *have* looked about fairly extensively for some form of coherant and
coplete doc or howto but they are all vague and I have seen numerous
postings that others have problems. If I get it figured out I will post
my explicit cleaned up instructions somewhere so others with no ruby
experience whatsoever can repeat the process easily.

GOAL I want to get ruby and Rake up on cygwin. windows XP pro sp2 so I
can evaluate rake as the "make and ant" killer and maybe use it as our
primary cross platform build system. AND also to create an explicit set
of non-vague repeatable sitructions for others to do so.

I am following the "pickaxe book" bit on getting started.

**** So far

I downloaded and installed cygwin "fresh" as an administrator and
included the ruby package "1.8.7-p72-1". (latest)
the command ruby is found from the bash shell after installation.

~$ which ruby
/usr/bin/ruby

There is no RUBYOPT in my environment variables.

~$ echo X $RUBYOPT X
X X

from a cygwin bash shell.

~$ ruby
(now in ruby shell)
puts "xxx"
(control D)
xxx
~$

The interpreter seems to work.

I downloaded a copy of "OneClickInstall to get that version as a
reference and unpacked it so I could get the "samples", I did not run
it's ruby and removed it from the path it installed so as not to
conflict with cygwin. I also removed the RUBYOPT environment variable
it installed, closed and re-opened the bash shell to purge it's cache,
then:

~$ echo X $RUBYOPT X
X X

I found the "samples" directory from the one click install and found
eval.rb.

~$ cd /cygdrive/c/ruby/samples/RubySrc-1.8.6-p111/sample$ ls eval.*
/cygdrive/c/ruby/samples/RubySrc-1.8.6-p111/sample$ ls eval.*
eval.rb

from bash:

/cygdrive/c/ruby/samples/RubySrc-1.8.6-p111/sample$ ruby ./eval.rb
ruby: no such file to load -- ubygems (LoadError)

Ok I saw several places one had to install "rubygems" in "ths customary
way" ok so I guessed what the "customary way" is,
I downloaded. rubygems-0.8.11.zip
It unpacks to a directory ./rubygems-0.8.11/*

Ok where do I put it? in /usr/lib/rubygems-0.8.11 ??
I tried this
(this did not get rid of the load error)
I renamed to to /usr/lib/ruby
(this did not get rid of the load error)

where do I go from here:

(the objective here is to expand this into an explicit step by step set
of instructions for getting ruby and rake set up under cygwin-XP

a - so I can do it to evaluate rake as a "make and ant killer"
b - so others can repeat this process without needing to ask questions
to set up their machines :)

Peter K.
--
Posted via http://www.ruby-....