[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Ruby and Cygwin

Li Chen

12/23/2006 1:09:00 AM

Hi all,

I install a Ruby version from within Cygwin. 1) How do I use
Interreactive ruby from Cygwin? 2) How do I query Ruby from Cygwin? 3)
Which text editor do you guys prefer when working under Cygwin?

Thanks,

Li

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

11 Answers

M. Edward (Ed) Borasky

12/23/2006 1:35:00 AM

0

Li Chen wrote:
> Hi all,
>
> I install a Ruby version from within Cygwin. 1) How do I use
> Interreactive ruby from Cygwin? 2) How do I query Ruby from Cygwin? 3)
> Which text editor do you guys prefer when working under Cygwin?
>
> Thanks,
>
> Li
>
>
Well, before the anti-cygwin folks jump in here :)

1. Just open a Cygwin command window (or an xterm) and type "irb" at the
prompt.
2. I'm not sure what you mean by "query Ruby"?
3. Cygwin has vim, emacs and xemacs. I prefer vim. If you have Cygwin X,
you also will have "gvim".

Other notes:

1. If you download and install the "gem" tarball, RubyGems works as
advertised.
2. I have not tried the Cygwin compile/link toolchain with C extensions,
so I don't know if that works or not. That's the main reason people
don't like the Cygwin port -- it's confusing for all except "pure Ruby"
to have to deal with three different compilers -- Microsoft's, "mingw"
and Cygwin's.

If you need to deal with non-Ruby extensions, my recommendation would be
to get the one-click installer and use the precompiled Gems, rather than
trying to mess with Cygwin. But if you're dealing with pure Ruby, Cygwin
is fine.

--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blo...

If God had meant for carrots to be eaten cooked, He would have given rabbits fire.


Li Chen

12/23/2006 1:52:00 AM

0

M. Edward (Ed) Borasky wrote:
> 1. Just open a Cygwin command window (or an xterm) and type "irb" at the
> prompt.

It doesn't work for me.

chen41@path-1qydp61 ~
$ irb
/usr/bin/ruby: no such file to load -- ubygems (LoadError)

> 2. I'm not sure what you mean by "query Ruby"?
search methods such as C:\>ri Array.new

Li

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

M. Edward (Ed) Borasky

12/23/2006 2:06:00 AM

0

Li Chen wrote:
> M. Edward (Ed) Borasky wrote:
>
>> 1. Just open a Cygwin command window (or an xterm) and type "irb" at the
>> prompt.
>>
>
> It doesn't work for me.
>
> chen41@path-1qydp61 ~
> $ irb
> /usr/bin/ruby: no such file to load -- ubygems (LoadError)
>
>
>> 2. I'm not sure what you mean by "query Ruby"?
>>
> search methods such as C:\>ri Array.new
>
> Li
>
>
Ah ... type "unset RUBYOPT" at the command prompt and try it again

Or install rubygems.

--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blo...

If God had meant for carrots to be eaten cooked, He would have given rabbits fire.


Li Chen

12/23/2006 2:41:00 AM

0

M. Edward (Ed) Borasky wrote:

> Ah ... type "unset RUBYOPT" at the command prompt and try it again

It works. But what annoys me is that I have to type this commmand every
time when I start a new window. Is there another way to avoid this
situation?

>
> Or install rubygems.

How? Where can I find this howto under Cygwin ?

BTW: Is it possible to run a Ruby script from within gvim editor?


Thanks,

Li

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

David Vallner

12/23/2006 12:56:00 PM

0

M. Edward (Ed) Borasky wrote:
> 3. Cygwin has vim, emacs and xemacs. I prefer vim. If you have Cygwin X,
> you also will have "gvim".
>

Of which all three (four?) exist and work under Windows natively, so you
can spare yourself an epicycle there unless you're sshing into the
Cygwin setup.

David Vallner

Jim Cochrane

12/23/2006 4:06:00 PM

0

On 2006-12-23, Li Chen <chen_li3@yahoo.com> wrote:
> M. Edward (Ed) Borasky wrote:
>
>> Ah ... type "unset RUBYOPT" at the command prompt and try it again
>
> It works. But what annoys me is that I have to type this commmand every
> time when I start a new window. Is there another way to avoid this
> situation?

(Assuming that the shell you are using is bash, which, AFAIK is the
default shell in cygwin:) Put the unset command in the .bash_profile
file in your home directory. If you need more info. about this, try the
cygwin docs and/or ask some more questions in an appropriate usenet group.
(This group is probably appropriate, but there may be better one - with
more cygwin experts.)


--

Li Chen

12/23/2006 4:58:00 PM

0

Jim Cochrane wrote:
> (Assuming that the shell you are using is bash, which, AFAIK is the
> default shell in cygwin:) Put the unset command in the .bash_profile
> file in your home directory. If you need more info. about this, try the
> cygwin docs and/or ask some more questions in an appropriate usenet
> group.
> (This group is probably appropriate, but there may be better one - with
> more cygwin experts.)

I search google and find out how to avoid it by deleting RUBYOPT from
path within enviroment variables under XP.

Li


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

M. Edward (Ed) Borasky

12/23/2006 7:03:00 PM

0

David Vallner wrote:
> M. Edward (Ed) Borasky wrote:
>
>> 3. Cygwin has vim, emacs and xemacs. I prefer vim. If you have Cygwin X,
>> you also will have "gvim".
>>
>>
>
> Of which all three (four?) exist and work under Windows natively, so you
> can spare yourself an epicycle there unless you're sshing into the
> Cygwin setup.
>
> David Vallner
>
>
I will add, as a happy GVim user, that the Windows native version is
*much* more attractive than either the Cygwin X-Windows "gvim" or its
Linux cousin/ancestor. When I'm on Windows, I use Windows GVim, and when
I'm on Linux or Cygwin, I use the regular "vim" from an XTerm or other
command shell window.

I never bothered to learn either emacs or xemacs, so I can't comment on
their use, either native Windows or Cygwin/Linux.

--
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
http://borasky-research.blo...

If God had meant for carrots to be eaten cooked, He would have given rabbits fire.


Jim Cochrane

12/23/2006 7:21:00 PM

0

On 2006-12-23, Li Chen <chen_li3@yahoo.com> wrote:
> Jim Cochrane wrote:
>> (Assuming that the shell you are using is bash, which, AFAIK is the
>> default shell in cygwin:) Put the unset command in the .bash_profile
>> file in your home directory. If you need more info. about this, try the
>> cygwin docs and/or ask some more questions in an appropriate usenet
>> group.
>> (This group is probably appropriate, but there may be better one - with
>> more cygwin experts.)
>
> I search google and find out how to avoid it by deleting RUBYOPT from
> path within enviroment variables under XP.
>
> Li
>

Yes, that's a better solution.

--

Li Chen

12/23/2006 7:56:00 PM

0

M. Edward (Ed) Borasky wrote:
> I will add, as a happy GVim user, that the Windows native version is
> *much* more attractive than either the Cygwin X-Windows "gvim" or its
> Linux cousin/ancestor. When I'm on Windows, I use Windows GVim

How do you run a Ruby script using Windows GVim? What I do is to write
a script with GVim, save it, then open a window prompt, CD to the folder
containing the script, and run it with "ruby test1.rb" or "test1.rb". I
cannot find a shortcut (for example, just press F5 key or other keys)to
run the script directly from GVim.

Thanks,

Li

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