Skip to content

New Rails project with Torquebox

January 23, 2013

I’m a true believer of Torquebox on Rails. The Java ecosystem of technologies is vast, mature, and sophisticated and Torquebox take the right approach at leveraging it all. The latest Torquebox (imminent 2.3.0) will have JRuby 1.7.2 support, and you can enable invokedynamic support.

New Torquebox Rails Project

Geting started is as easy as torquebox rails [your app name]

Modify Gemfile to allow both MRI Ruby and Torquebox JRuby

This provides you with the app/* additional directories and config/* additional files for Torquebox, and everything still works with MRI. The Gemfile changes simply swap out the dependencies based on “platform”.

What do I check-in to source control?

Whatever Gemfile.lock you want to use for development. If you want to develop in JRuby/Torquebox, then feel free to check in the original Gemfile.lock, otherwise do the following:

  1. Delete Gemfile.lock # just from local directory, not from version control
  2. Switch to whatever Ruby you want to use for Dev: MRI, Rubinius, Torquebox JRuby, whatever
  3. Run “bundle” # If you have the Gemfile from above you’ll have a Gemfile.lock with changes for the Ruby VM you ran bundle with.
  4. Check that file into source control. Now all devs for the project can use that agreed upon development setup. And you can still run JRuby in test/prod to gain performance improvements.
How do I make sure it works in Torquebox then?

I use a file checked into RAILS_ROOT directory, that I can just “source torquebox.env” and then my app is ready to be started in torquebox.

 

Advertisements

From → Ruby

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: