JRuby is something we’re very excited about as it bridges the gap between the Java and Ruby worlds, bringing a wide range of new advantages to developers.
You can take advantage of the mature JDBC, utilize Java Application Servers such as Glassfish for deployment with simple WAR’s rather than Capistrano, or use existing JavaBeans and business logic written in Java to plug into a much better framework.
We’re pleased to be the first infrastructure company to stand firmly behind JRuby, offering it as part of our standard Accelerator packages.
Getting started is easy. In our Accelerators you will JRuby 1.0.0RC2 in /opt/jruby. JRuby comes complete with the jruby interpreter which is used just like ruby, including friends gem, jirb, and more. Let’s take a look at how to get started:
[z010101CA:~] admin$ export PATH=/opt/jruby/bin:$PATH [z010101CA:~] admin$ jirb irb(main):001:0> string = 'JRuby Rules!' => "JRuby Rules!" irb(main):002:0> print string JRuby Rules!=> nil irb(main):003:0> string.upcase => "JRUBY RULES!" irb(main):004:0> quit
It’s really that simple.
Want to do some JRuby on Rails work?
There you go. No tricks, no gimmicks. Just start playing.
For those who don’t have a Joyent Accelerator, download JRuby here: JRuby.org.
6 responses to “Getting Started with JRuby”
ok so I did this but when I do require ‘java’ in a controller I get: no such file to load — java.
what else am I missing here?? (I’m on an AC200 M)
Never mind … move along nothing to see here. I missed the jruby script/server. Everything is working fine and dandy
I assume someone would use this to (hopefully) help speedup the performance of Ruby.
How does someone load balances JRuby? Does mongrel still apply? I would think not, though I’m not sure.
@Tim: I haven’t looked closely at it, but from what Ben said about war file deployment on glassfish, I assume you could rely on a java appserver to do the load balancing for you. I’ve used JBoss in the past, and it was very rich in that department.
@Joyent: In a similar vein to JRuby is a language called Groovy. It’s a very impressive project, and a really great environment to code in. Is there any likelihood of it appearing on TxD’s servers? Have you looked at Groovy at all?
You load-balance it like “normal”, it’s on a port on a private IP and you direct traffic that way.
No mongrel doesn’t apply, you could use the jruby/java port of it, but you’d use a java app server like glassfish instead.
Please of please Joyent post more to the blog.
I feel starved when there isn’t anything to read for days on end 🙂