Ruby and Cygwin

L

Li Chen

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
 
M

M. Edward (Ed) Borasky

Li said:
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.
 
L

Li Chen

M. Edward (Ed) Borasky said:
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
 
M

M. Edward (Ed) Borasky

Li said:
It doesn't work for me.

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


search methods such as C:\>ri Array.new

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

Or install rubygems.
 
L

Li Chen

M. Edward (Ed) Borasky said:
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
 
D

David Vallner

--------------enig40C91D48840C6D50C3869C2D
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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

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


--------------enig40C91D48840C6D50C3869C2D
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)

iD8DBQFFjSdry6MhrS8astoRAn/yAJ9CqqKPr8jyqig9Deh5wJSqTm7czwCeIv/P
B3P4EWoQUiTdFJB/WptX8X8=
=KwzK
-----END PGP SIGNATURE-----

--------------enig40C91D48840C6D50C3869C2D--
 
J

Jim Cochrane

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.)


--
 
L

Li Chen

Jim said:
(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
 
M

M. Edward (Ed) Borasky

David said:
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.
 
L

Li Chen

M. Edward (Ed) Borasky said:
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
 
P

Pit Capitain

Li said:
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.

Hi Li,

on RubyGarden there should be many infos about using Vim for Ruby
programming. You could start here:

http://wiki.rubygarden.org/Ruby/page/back_links/CategoryEditor

Happy holidays everybody,
Pit
 

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

Forum statistics

Threads
474,197
Messages
2,571,041
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top