Knowledge Base/Engine Yard Cloud Documentation/Deploy your Application

Deploy JRuby Applications

Engine Yard
posted this on February 16, 2012 10:02 AM

This page provides some information about running a JRuby application on Engine Yard Cloud.

This is the process:

Note: If you are using a free trial account, see Deploy JRuby applications in trial accounts.

About JRuby and C extensions

Loading C extensions (cext) is disabled for JRuby on Engine Yard Cloud. If cext support is necessary for your application, please submit a ticket with Engine Yard Support and tell us why.

About the web_apps option

Engine Yard’s Trinidad application server does not support the :web_apps option. (The :web_apps option allows configuration of several Rails applications within the same Tomcat container.)


Prepare your local machine for JRuby

If you are new to JRuby, follow the procedure below to prepare your local machine to develop and test JRuby code.

If you are already running JRuby on your local machine, review the procedure below. If you use the Engine Yard CLI, do Step 5.

To prepare your local environment and application for JRuby

  1. Install JRuby.

    rvm install jruby 
    rvm jruby
  2. Verify that you have installed Bundler 1.0.10 or later.

     bundle -v
  3. Add the following to your Gemfile:

    platforms :jruby do 
    gem 'jruby-openssl'
    gem 'trinidad'
    gem 'activerecord-jdbc-adapter'

    # Choose the jdbc driver according to your database engine
    gem 'jdbc-postgres', :require => false
    gem 'jdbc-mysql', :require => false
    gem 'jdbc-sqlite3', :require => false
  4. Run these commands to update your Gemfile.lock:

    bundle install 

    git commit -a -m "Gemfile updated for JRuby/Trinidad"
    git push origin
  5. (Optional) To use the Engine Yard CLI tool, run these commands:

    rvm --create jruby@ey exec gem install engineyard 
    rvm wrapper jruby@ey --no-prefix ey


Run a JRuby application on Engine Yard Cloud

Running a JRuby application is similar to running any Ruby application. The main difference is that you set the Application Server to Trinidad.

To run a new JRuby application on Engine Yard Cloud

  1. In your Dashboard, create an application.

  2. Create the environment, setting the Application Server to Trinidad.
    When the Application Server is set to Trinidad, the Runtime defaults to JRuby 1.6.5 compatible with Ruby 1.8.7.
    For JRuby compatible with Ruby 1.9.2, set the Runtime to JRuby 1.6.5 (ruby–1.9.2-p136).

  3. Deploy the application.


More information

For more information about...See...
configuring Trinidad Advanced configuration
the Engine Yard CLI Engine Yard CLI User Guide                                                                    
Bundler Bundler tips

If you have feedback or questions about this page, add a comment below. If you need help, submit a ticket with Engine Yard Support.