You never know what OS you will be required to work from so I like using cross platform programs, ones that work with Windows, Linux and MacOS. And they are nearly always open source – Firefox, OpenOffice, GAIM…. And JEdit.
Recently I’ve been playing around with Ruby, a programming language that has been around for a while but more recently has been gaining popularity, mainly due to a new web framework for ruby, Ruby on Rails.

The core developers of Rails all use Macs, and all use an editor called TextMate. Which isn’t cross platform. Oh, it’s not open source and it’s not free either. But it has been touted as the best editor for Rails. Why? Well I’m not too sure, I don’t think it even has autocompletion ( just abbreviations, iirc).
There are other IDEs for Ruby on Rails, A good one is RadRails, It’s cross platform and has some nice ruby/rails features, but it’s not a general purpose editor.
JEdit is cross platform, open source, free and it has some nice plugins for Ruby and Ruby on Rails. Along with that, it can edit html, php, sql or any other language just as easily.
Follow the instructions at http://rubyjedit.org/download/ . There are a few “gotchas” though and I will attempt to step you through them to get your JEdit up and running for Ruby on Rails.
{userhome} is of course /home/yourusername if you are on Linux, or C:\Documents and Settings\yourusername
{install-dir} is where JEdit is installed and on linux that can depend, on windows it’s usually C:\Program Files\Jedit.
You may have to restart JEdit after installing the Project Viewer and SideKick plugins before the Ruby plugin shows up.
Once you have followed the instructions, you might load up a ruby file and find that auto completion doesn’t work.
Here is the missing step : In Plugins->Plugin Options->Sidekick->Parsers select ‘ruby’ as the ruby parser. If ruby doesn’t show up in the dropdown, restart JEdit. If it still doesn’t show up, check that all your plugins are enabled.
Docks. It’s not too obvious how to get a new dock like on the screenshots at http://rubyjedit.org/features/ so here it is. First, to get a floating ruby documentation window, click Plugins->RubyPlugin->Ruby Documentation.
Now click the little arrow and ‘dock to right’ ( or left etc).
Now auto competion should work. If you assigned the suggested shortcuts, you should be able to open a Model file and type has_<CTRL+TAB> and get a drop down of the methods starting with has_ e.g. has_many. Also, the matching documentation should show up in the documentation window :)
Some extra plugins. In the plugin manager, you can select plugins to install and it will download and install them for you. Some ones I use :
Console. This allows you to run script/console in your Rails app. Or IRB.
To get this going, select the Console plugin for downloading in the Plugins manager.
It works a lot better than the radrails console and allows you to interact with your rails app.
Have a look in the plugin manager for others. JEdit is very powerful and has support for macros, and lots of extensions. There is a lot to learn :)
These can make coding quicker by completing common typing tasks for you. Jesse from ifakedit.com has already written a howto on Abbreaviations for ruby on rails, so I suggest you read it!
TODO: Still needed is some macros to start and stop webbrick, and run ruby code through script/console.
Comments
blog comments powered by Disqus