Develop Ruby Applications Using SciTE Editor
- Develop Ruby Applications Using Eclipse IDE
- Develop Ruby Applications Using Komodo IDE
- Develop Ruby Applications Using SciTE Editor(this post)
- Develop Ruby Applications Using JEdit Editor
- Develop Ruby Applications Using Vim 7.0 Editor
In the first and second parts of the series “Popular IDEs For Ruby Development”, I have mentioned two of the excellent IDEs available for developing Ruby applications:
1. Ruby Development With Eclipse IDE
2. Ruby Development With Komodo IDE
Though these IDEs boast of a large number of useful features to help developers achieve higher productivity levels, some people might find the very same features to be needless quirks that come in the way of the software development. For all the programmers who swear by the rich functionality provided by an IDE like Eclipse, an equal number of programmers feel more comfortable and more productive with simple but elegant, fast to load editors like Emacs and Vi. One such popular editor which has got inbuilt support for the Ruby programming language is SciTE. I will discuss Ruby program development with the SciTE editor in this post; Ruby development with Emacs and Vim will be the topic of the next post in this series.
SciTE is actually one of my favourite editors to develop Ruby programs. The reasons are very basic: it’s light-weight, it’s fast, it has out-of the box support for the Ruby language(no plugins as in Eclipse or editing modes as in Emacs are needed to be installed) and it runs on multiple platforms including Windows and GNU/Linux. It also has got excellent support for the other programming languages(more than 40!) like C/C++, Java, Perl, Python and PHP. And of course its free in every sense of the word.
Open the SciTE editor from the system menu or from the command line, create a new file and save the file with .rb extension; the editor will automatically switch to the Ruby mode and will do the appropriate syntax highlighting for the code. The Ruby language can also be explicitly selected for the program currently being edited, by selecting Language->Ruby menu item.

Once the editing is complete, the Ruby program can be executed by selecting the menu item Tools -> Go or by pressing the F5 key.

A new pane will be opened on the right side of the window to run the script and it will show if any errors are present in the program, or the output of the program otherwise.

Once all the errors in the program are fixed, pressing the F5 key will show the output of the program in the right pane.

With fast load times, support for syntax highlighting and code indentation, ruby interpreter and ruby interactive shell being supported from within the editor, SciTE provides an excellent environment for Ruby application development. It doesn’t end here though; SciTE also allows a lot of customisations to be done to the programming environment according to the tastes of the programmers. To affect the global settings of the editor that apply to the settings of all the programming languages(not just Ruby), select Options -> Open Global Options File menu item.

As an example, scroll down to around line 100(View -> Line Numbers to view the line numbers) and search for a property called “tabsize” and change it to 4(or whatever you prefer). Or scroll down roughly to the line number 300 and increase/decrease the font size by editing font.base property(under your platform):

Settings specific to the Ruby mode can be customised by going to Options -> Edit Properties -> Open ruby.properties.

You will see a similar list of properties that were present in the global properties file and the values of specific properties can be edited in the same way.

Ruby interactive shell can also be used from within the SciTE editor to test simple Ruby expression before using them in the programs. Just place the cursor in the right pane(output window; go to View -> Output if it is already not visible), type the command ‘irb’ and press the ENTER key. You will be dropped to an irb shell where you can experiment with various Ruby expressions.

I prefer to work with the SciTE editor(not just for Ruby) for various reasons pointed out earlier in this post. Most important of them all are that its available for both Windows and GNU/Linux(it looks and works the same way in both these OSes) and it supports most of the programming languages that I use. If you open a lot of different files for editing during one marathon editing session, you can save the state for later retrieval by saving and loading the sessions. The program files can also be exported to different document formats like PDF, RTF, HTML etc(from File -> Export menu). If you are searching for a light-weight, fast, multi-platform programming editor, then SciTE will be a great option to consider.
Related Posts:
Readers who viewed this page, also viewed:
- Develop Ruby Applications Using JEdit Editor
- Installing Ruby on GNU/Linux(Gentoo, (K)Ubuntu, Fedora, SUSE) And MS Windows
- Develop Ruby Applications Using Vim 7.0 Editor
- Develop Ruby Applications Using Komodo IDE
- Programming in Ruby Using SciTE - Windows Issues and Other Tips
I am having few problems with SciTE (version 1.67).
Quote- irb command is not recognized in the ouptut winodw
- can’ type anything in the DOS command window when it is opened via gets.
Any help?
Thanks, Mihail
Comment by mihail — October 20, 2006 @ 1:40 am
Are you using SciTE under GNU/Linux or Windows?
QuoteFollow these steps:
Start the SciTE editor; go to View -> Output; in the output window, type the command ‘ri Kernel#gets’ and see what result it generates. What happens when you type the ‘irb’ command?
Comment by tabrez — October 20, 2006 @ 12:17 pm
For both - “the system cannot find the file specified”.
QuoteWhen run them in a DOS Command Prompt both work - the path is set right.
I am confused…
Comment by mihail — October 23, 2006 @ 11:04 pm
i am having problems creating a program to remember what has been typed? it is basically creating your own “key logger,” any suggestions?
QuoteComment by moe — November 25, 2006 @ 2:55 am
I think you may need to type irb.bat in the command window in you are running scite on windows
QuoteComment by Guillermo — July 4, 2007 @ 3:54 pm
I have the same problem as Mihail,
To reiterate:
- irb command is not recognized in the ouptut winodw
- can’ type anything in the DOS command window when it is opened via gets.
I’m using Vista. I basically have to open the command prompt and run my programs from there when using Ruby.
QuoteComment by Jonathan — October 11, 2007 @ 8:07 am
Mihail, Jonathan:
irb.bat
ri.bat IO#read
Or you can create shortcuts to these commands. If you use these commands frequently, you can also create a menu item for them in “Tools” menu by adding the following lines to the Ruby properties file(Windows section only):
command.name.0.*.rb=irb
command.0.*.rb=irb.bat
command.is.filter.0.*.rb=1
command.0.subsystem.*.rb=1
You can now invoke irb from Tools -> irb or by pressing Ctrl-0 key combination. (Use another number instead of 0 if you have already bound Ctrl-0 to something else.)
To know more about what the above properties mean, refer to SciTE documentation from Help -> SciTE Help menu item.
Let me know how it goes. I will probably make a separate post to talk about the issues specific to Windows.
QuoteComment by tabrez — October 12, 2007 @ 6:23 pm
[...] of comments(by Mihail and Jonathan) on my earlier post about programming in Ruby using SciTE editor brought this to my notice: When using SciTE to develop Ruby programs on Windows platform, there are [...]
QuotePingback by Programming in Ruby Using SciTE - Windows Issues and Other Tips — October 14, 2007 @ 4:07 pm