One of the beauties of the Ruby community is the benefit of choice. Original Ruby interpreter? Check. Ruby interpreter in Java? Check. Ruby interpreter in Ruby? Check. Ruby for .NET? Check. Projects like these make it easier to integrate Ruby in almost any environment.
Specifically, the development of JRuby has been full steam ahead ever since Sun decided to hire two developers on full-time to work on the JRuby project. This has meant constant releases, each with a large change set. The project has most recently hit its 1.1 state which includes a 100% compatible Ruby 1.8.6 interpreter written completely in Java. This means you can simply drop the JRuby JAR file in your Java project and begin writing Ruby code. Or you can go ahead and integrate Swing into your Ruby application; seamlessly.
I work for a Fortune 100 company, a defense contractor with a pretty strict development environment. What does this mean? For the most part I’m limited to Windows, anything I would like installed on my PC needs to go through an approval process (which can take 3-6 months, easily) and the existing choice of tools is quite limited. Luckily, Java is one of the big hitters for development in the software department. The standard load on my PC contains a pretty recent JRE/JDK which opens the door to JRuby. JRuby at this point is simply a drop in, a tool I can integrate to my existing environment. It’s not an executable that needs to be virus scanned or something that shows up in the wonderful Windows “Add/Remove Programs” dialog.
And it is wonderful.
Next, enter NetBeans, an IDE for the big hitter languages; C++, Java and most recently, Ruby and Javascript. NetBeans is one of the few tools that makes working in Windows a pleasure. I’m a Mac guy, so spending 9 hours at work on a PC can be painful at times but a properly configured NetBeans can give me an IDE that looks similar to TextMate. Couple this with Cygwin and I’ve got a pretty similar development environment as I would in a Mac or Linux environment. Built in Autotest, incredible code completion (including completion on your ActiveRecord models) and integration with the major SCM tools out there makes NetBeans a necessary tool when working with Ruby in Windows.
JRuby has full support for Rails. Now I have the option to either work in Rails or the company blessed solution of ColdFusion. Tough choice, eh? With JDBC drivers for every major database out there, I can quickly prototype and develop applications against both Oracle and PostgreSQL which I have at my disposal.
JRuby also has a great community with an active mailing list. Hit a bug? Missing a feature? Go ahead and submit a ticket to their JIRA bug tracking instance and chances are it will get addressed in the next release. I ran into a bug with the JDBC-PostgreSQL driver, browsed their bug tracking library and found that not only had it been submitted already, but Ola Bini, one of their active developers had corrected the bug that morning and posted a fix that I was able to grab and continue on with my development.
But what about getting Ruby accepted by others in your environment? I think the general consensus on this has been to simply go ahead an whip up an application and go ahead and demo it. Show off the benefits, the clean code and the time saved by using Ruby over whatever you would have otherwise built the tool with. Ask for forgiveness later.
So the next time you have that itch to integrate Ruby (or Rails) at work, go ahead and give JRuby a look. You’ll be a much happier person because of it and your co-workers who are unfamiliar with Ruby will thank you.
5 comments ↓
Great to hear about someone using JRuby to sneak ruby into stubborn environments. How did it end up working out?
[…] on Rails’ applicability within the corporate world. One a somewhat related note, you can read JRuby - Or how I manage to write Ruby in a strict corporate environment and Why I think Ruby on Rails is an ideal web development environment by Andy […]
Thanks for the comment Mark. It works out wonderfully. Because a lot of the systems we work with are legacy systems, I have stepped up and have become the R&D guy in the group; searching for new ways we can more quickly develop as well as migrate to newer technologies so we’re not digging ourselves deeper in the stone age.
Oddly enough I am in a similar situation like you, working for big defense contractor. I have playing around with JRuby also and looking for an opportunity to sneak it in shortly. One problem I have faced is that with our firewalls and all http traffic thru proxy server, the gem installation has not worked for me. I have tried setting the http_proxy env variables but nothing has worked so far. Did u face similar issues and if u did how did u work around them? BTW while posting this message I saw this blog post at http://ashishkulkarni.blogspot.com/2006/07/installing-ruby-and-rails-framework.html that provided a link to download gems directly from http://rubyforge.vm.bytemark.co.uk/gems/ but u still have to worry about dependencies.
This was something I ran into actually. However, using the HTTP_PROXY environmental variable was all I needed to get up and running. Since we’re on a Windows network it was simply in the form of http://windows_login:password@proxy:port and I was up and running with gem support.
Another thing that has slowed my pace is the lack of Subversion which has made a few things prove difficult. script/plugin install’s don’t always go as planned and I sometimes have to download the archive and uncompress it in my vendor directory myself.
I’ll keep an eye out for a solution but for now it looks like installing gems by themselves might have to be the solution for you; for now. Good luck!
Leave a Comment