small medium large xlarge

Deploying with JRuby: Deliver Scalable Web Apps using the JVM


Cover image for Deploying with JRuby

Deploying with JRuby

Deliver Scalable Web Apps using the JVM


Deploy using the JVM’s high performance while building your apps in the language you love. JRuby is a fast, scalable, and powerful JVM language with all the benefits of a traditional Ruby environment. See how to consolidate the many moving parts of an MRI-based Ruby deployment onto a single JVM process. You’ll learn how to port a Rails application to JRuby, get it into production, and keep it running.

Paperback list price normally $33.00, now on sale for $9.95 while supplies last.

About this Title

Pages: 224
Published: 2012-08-15
Release: P1.0 (2012-07-09)
ISBN: 978-1-93435-697-5

NEW: See this video on using Torquebox for high-availability deployment on the JVM.

JRuby deployments have fewer moving parts and consume less memory than traditional Ruby deployments, but to deploy your apps on the JVM, you need to learn some new approaches. This book introduces you to three JRuby deployment strategies that will give you the performance and scalability you need while letting you use the language you love.

You’ll start by porting an existing application to JRuby, preparing the app to take advantage of the JVM platform. Then you’ll use Vagrant and Puppet to build a virtual production environment so you have a stable, reproducible place to explore JRuby deployment.

With your environment in place, you’ll experiment with simple JRuby deployment with Warbler as you package your Ruby web application into a single file you can deploy to a Java application server. Next you’ll set up the lightweight Trinidad web server to create a more flexible, modular deployment that fits more complex situations but still feels friendly and familiar to Ruby developers. You’ll switch to powering your app with TorqueBox, an all-in-one JRuby environment that includes built-in support for messaging, scheduling, and daemons—perfect for handling the “big jobs.” Then, you’ll set up a continuous integration environment with Jenkins so you can deploy like the pros.

Deploying with JRuby is the missing link between enjoying JRuby and using it in the real world to build high-performance, scalable applications.

Want to see how easy it is to do? Watch the video above.

What You Need:

To run the examples in this book, you’ll need a computer that can run the Java Virtual Machine.

Read the reviews .

Contents & Extracts


  • Getting Started with JRuby
    • What Makes JRuby So Great? excerpt
    • Introducing Warbler excerpt
    • Preparing Twitalytics for JRuby
    • Configuring Warbler for Twitalytics
    • Wrapping Up
  • Creating a Deployment Environment
    • Creating a Virtual Server excerpt
    • Provisioning with Puppet
    • Packaging the Deployment Environment
    • Using Alternative Platforms
    • Wrapping Up
  • Deploying an Archive File
    • Provisioning a Server
    • Installing Apache Tomcat
    • Creating the Deployment Script
    • Using Precompiled Assets with Warbler
    • Deploying to the Cloud
    • Wrapping Up
  • Creating a Trinidad Application
    • What is Traditional Deployment
    • Getting Started with Trinidad
    • Adding Trinidad Extensions
    • Choosing Alternatives to Trinidad
    • Wrapping Up
  • Deploying A Trinidad Application
    • Provisioning a Server
    • Installing Trinidad as a Service
    • Hot-Deploying with Capistrano
    • Configuring Apache
    • Choosing Alternative Deployment Strategies
    • Wrapping Up
  • Creating a TorqueBox Application
    • What is an Application Server
    • Getting Started with TorqueBox
    • Creating a Deployment Descriptor
    • Using the Management Console
    • Scheduling a Recurring Job
    • Creating a Long-Running Daemon
    • Running Background Jobs
    • Pushing to the Browser with Stomplets
    • Testing a TorqueBox Application
    • Wrapping Up
  • Deploying a TorqueBox Application
    • Choosing a Deployment Strategy
    • Creating a Deployment Environment
    • Installing TorqueBox
    • Deploying an Archive File
    • Wrapping Up
  • Clustering a TorqueBox Application
    • Creating the Cluster
    • Installing the Apache Cluster Module
    • Deploying to the Cluster
    • Using High-Availability Jobs and Services
    • Using Session Replication
    • Running in Domain Mode
    • Wrapping Up
  • Managing a JRuby Deployment
    • Configuring the Runtime
    • Inspecting the Runtime with JMX
    • Managing the Runtime with JMX
    • Creating a Management Bean
    • Profiling an Application
    • Wrapping Up
  • Using a Continuous Integration Server
    • Installing Jenkins
    • Creating a Git Depot
    • Creating a Jenkins Job
    • Archiving Artifacts with Jenkins
    • Wrapping Up


Joe Kutner has been building JRuby applications since 2006 for clients including IBM and NASA. Today, he is a professional software consultant building Ruby and Rails applications for customers of all sizes. Joe also contributes to several JRuby projects including TorqueBox and Trinidad.