What's the difference between ".rb" and ".rbw" files?
As you probably know, Windows associates certain filename extensions with certain programs. For example, double-click on a file with the ".xls" filename extension, and the file will be opened in Microsoft Excel (if it is installed). Use the One-Click Ruby Installer, and your ".rb" and ".rbw" files will be associated with the Ruby interpreter, so that double-clicking on a Ruby script automatically runs the script in the Ruby interpreter.
But there are two Ruby interpreters installed on Windows, ruby.exe and rubyw.exe. ruby.exe is the standard interpreter, which runs your script in a command/console window. rubyw.exe is essentially the same as ruby.exe, but without the console window, so any output to the console (ie, 'puts' statements or error messages) will not be seen.
Files with a ".rb" filename extension are associated with ruby.exe, while files with a ".rbw" filename extension are associated with rubyw.exe. Double-click on a ".rb" file in Windows Explorer and the script will open up a console window -- while it is running. The console window will automatically close when the script stops running. Double-click on a ".rbw" file in Windows Explorer and the script will run, but with no console window (and therefore no error messages).
To ensure you see the necessary console output from your script, run it from a command prompt, or from an editor/IDE that includes an output window.
For more answers to Frequently-Asked Questions, check out posts with the faq tag.
Thanks for stopping by!
Tuesday, May 15, 2007
FAQ: "script.rb" versus "script.rbw"
Posted by
David Mullet
at
7:52 PM
2
comments
Monday, May 14, 2007
FAQ: But don't I need an IDE?
No. A good lightweight text editor is all you'll need to start developing serious applications. I recommend that you start out with a lightweight editor, so that you can first get comfortable with the language (which won't take long). But as you become more comfortable using Ruby and your projects grow in complexity, you may wish to investigate a full-blown Integrated Development Environment (IDE).
When you do go looking for an IDE, you'll now have several to choose from...
Ruby in Steel allows you to develop Ruby in Microsoft's Visual Studio IDE, while Aptana integrates the former RadRails for developing Ruby on the Eclipse platform. ActiveState's Komodo IDE is the big brother of the Komodo Editor. Borland's CodeGear division (the Delphi people) just announced plans to jump into the Ruby IDE market later this year.
As usual, Google for further details and opinions on this topic.
For more answers to Frequently-Asked Questions, check out posts with the faq tag.
Thanks for stopping by!
Posted by
David Mullet
at
8:49 PM
3
comments
Sunday, May 13, 2007
Ruby on Windows FAQs
This series of posts is an attempt to consolidate and address some of the most frequently asked questions (FAQs) regarding using Ruby on Windows. You'll find these FAQ posts located under the faq tag.
There's no doubt more questions to be asked and answers to be provided. Please post a comment here or send me email.
Thanks for stopping by!
Posted by
David Mullet
at
9:27 AM
2
comments
FAQ: What text editor should I use?
Any text editor -- even Windows Notepad -- will do, so long as you can save your documents as straight text. You'll eventually want something a bit more robust than Notepad, such as the SciTE code editor that is installed by the One-Click Ruby Installer. More fully-featured code editors include the e Text Editor and ActiveState's Komodo Editor. Google for further details and recommendations.
For more answers to Frequently-Asked Questions, check out posts with the faq tag.
Posted by
David Mullet
at
9:14 AM
13
comments
FAQ: How do I install new code libraries?
The One-Click Ruby Installer includes RubyGems. RubyGems is a standard format for distributing Ruby programs and libraries, and provides an easy-to-use tool for managing the installation of gem packages. To install a new library such as watir via gem, open a command window and enter...
gem install watir
To uninstall, enter (you probably guessed this by now)...
gem uninstall watir
For complete details, check out the easy-to-read RubyGems User Guide.
Posted by
David Mullet
at
9:01 AM
0
comments
FAQ: How do I get to a command prompt?
Click your Windows Start button, then select Programs, then Accessories, then Command Prompt. Or click the Start button, select Run, type in 'cmd' and click OK. If you're not very familiar with the Windows command prompt, I recommend this brief but informative overview.
Posted by
David Mullet
at
8:58 AM
4
comments
FAQ: How do I install Ruby on Windows?
The One-Click Ruby Installer should meet your needs for a painless Ruby installation that includes most of the Ruby libraries you'll need starting out. It includes the SciTE Text Editor (my code editor of choice) and the WIN32OLE library, essential for COM automation.
For more answers to Frequently-Asked Questions, check out posts with the faq tag.
Posted by
David Mullet
at
8:53 AM
0
comments