Forum: Ruby Ruby and Cygwin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2006-12-23 02:09
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
3bb23e7770680ea44a2d79e6d10daaed?d=identicon&s=25 M. Edward (Ed) Borasky (Guest)
on 2006-12-23 02:36
(Received via mailing list)
Li Chen wrote:
>
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.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2006-12-23 02:51
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
3bb23e7770680ea44a2d79e6d10daaed?d=identicon&s=25 M. Edward (Ed) Borasky (Guest)
on 2006-12-23 03:08
(Received via mailing list)
Li Chen wrote:
> /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.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2006-12-23 03:40
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
430ea1cba106cc65b7687d66e9df4f06?d=identicon&s=25 David Vallner (Guest)
on 2006-12-23 13:56
(Received via mailing list)
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
0372bb881db5bbf5406de179b5beed1e?d=identicon&s=25 Jim Cochrane (Guest)
on 2006-12-23 17:11
(Received via mailing list)
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.)
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2006-12-23 17:57
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
3bb23e7770680ea44a2d79e6d10daaed?d=identicon&s=25 M. Edward (Ed) Borasky (Guest)
on 2006-12-23 20:05
(Received via mailing list)
David Vallner wrote:
>
> 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.blogspot.com/

If God had meant for carrots to be eaten cooked, He would have given
rabbits fire.
0372bb881db5bbf5406de179b5beed1e?d=identicon&s=25 Jim Cochrane (Guest)
on 2006-12-23 20:25
(Received via mailing list)
On 2006-12-23, Li Chen <chen_li3@yahoo.com> wrote:
> path within enviroment variables under XP.
>
> Li
>

Yes, that's a better solution.
73700e119917433681f2e8f3e4369f74?d=identicon&s=25 Li CN (alex-osu3)
on 2006-12-23 20:56
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
93d566cc26b230c553c197c4cd8ac6e4?d=identicon&s=25 Pit Capitain (Guest)
on 2006-12-24 18:02
(Received via mailing list)
Li Chen schrieb:
> 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/Ca...

Happy holidays everybody,
Pit
This topic is locked and can not be replied to.