Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Ruby Programming
Previous Page Home Next Page

Running Ruby Under Windows

There are two executables provided with the cygwin32 Ruby distribution: ruby.exe and rubyw.exe.

ruby.exe is meant to be used at a command prompt (a DOS shell), just as in the Unix version. For applications that read and write to the standard input and output, this is fine. But that also means that anytime you run ruby.exe, you'll get a DOS shell even if you don't want one---Windows will create a new command prompt window and display it while Ruby is running. This might not be appropriate behavior if, for example, you double-click on a Ruby script that uses a graphical interface (such as Tk), or if you are running a Ruby script as a background task, or from inside another program.

In these cases, you'll want to use rubyw.exe. It is the same as ruby.exe except that it does not provide standard in, standard out, or standard error, and does not launch a DOS shell when run.

You can set a file association[Using View/Options/Filetypes from Explorer.] so that files with the extension ``.rb'' will automatically use rubyw.exe. By doing this, you can double-click on Ruby scripts and they will simply run without popping up a DOS shell.
Ruby Programming
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire