Ruby, Eclipse, and Ferret - on Windows
I've started a new job, and I need a high productivity toolset for doing information retrieval experiments with.
First, there was the question of what programming language to learn. (There's a goal in the Pragmatic Programmer of learning at least one new language every year.) I've been hearing about Ruby since 2000, and of course in the last year Ruby on Rails has become all the rage. I'm doing quite a lot of web-based stuff at the moment, so having this framework available down the track should be useful. And, again due to OTI, I have a soft spot for anything which uses Smalltalk as such a strong part of its intellectual inheritance, while adding the useful parts of Perl which has always been a good tool for string manipulations. So I decided to finally check it out.
And ok - at long last I've bitten the bullet and started playing with new development environments for what seems like the first time in years. I know, I know, the die-hards will ask, "why would you bother leaving emacs". But since I worked for a time at OTI (back in the Envy Developer days) who I now see are finally known as the IBM Ottawa lab, I know there is an alternative. And of course, it's called Eclipse. Eclipse would be no use on its own, since it was originally built for Java, but luckily, there are the Ruby Development Tools for Eclipse.
These days, I've become acclimatised to running my desktop on Windows, despite for years having been a die-hard Mac boy, and then doing a lot of productive research using Linux as my desktop. So as an experiment, I decided to see whether I could be productive with Ruby and Eclipse on Windows.
It turns out not to be complex at all. Here's what I did:
- Downloaded and ran the One-Click Ruby Installer. This is a great piece of work - it just works! There's been a security patch release of Ruby (1.8.3) since the most recent version of the installer was released, but I'm running this on an all internal network, so no drama. Given that I was planning on downloading Eclipse as well, I probably didn't need to select some of the extra editing and debugging tools, but I wasn't sure how Eclipse was going to stack up.
- Neal Ford's IBM Developer works article on "Using the Ruby Development Tools plug-in for Eclipse" was a useful resource in working out what to do next. For Eclipse to work, I needed a Java runtime environment. I chose the J2SE v 1.4.2 one available from Sun. Install, "You must reboot" - I hate that. Reboot.
- Next I downloaded Eclipse, but just the platform runtime binary as I didn't want to do Java programming or write my own plug-in just yet. It's not exactly clear what you do with the downloaded zip file. I decided to extract it to C:\Program Files\eclipse. And then made a shortcut from the eclipse.exe and put it on my desktop.
- Next was the Ruby Development Tools, or RDT for short. The RDT site mentions three ways to obtain them. At first, I tried downloading the zipped file, but Windows refused to unzip it, citing security grounds. Good to see that security is taken very seriously these days at Microsoft! So next I followed the instructions on the RDT download page about using Eclipse's Update Manager. This worked fine. But you have to restart Eclipse.
- In the Arguments tab, add -Ku as a program argument.
- And in the Common tab, set the Console encoding to UTF-8.
- I downloaded the latest stable Ferret zip file.
- Extracted the zip file to a new Ferret directory in my chosen Eclipse workspace folder. This was ferret-0.1.3. Since Dave seems to be moving fast with new releases, I want to be able to download new versions in the same top level directory.
- Then I created a new Eclipse run configuration for the setup.rb file that lives in the top level directory of ferret-0.1.3, and ran it. It complained about not having make and a C compiler, but that's because I don't - as yet. Otherwise it all ran fine.
- Then I created a testFerret.rb file in my test workspace, and copied Dave's example Ferret program from the comp.lang.ruby group announcement post into it. One more run configuration, and hit run. And it all just worked!
0 Comments:
Post a Comment
<< Home