This page provides some information about running a JRuby application on Engine Yard Cloud.
This is the process:
- Set up your local environment for JRuby development and CLI deployment.
- Run a JRuby application on Engine Yard Cloud.
Note: If you are using a free trial account, see [[Deploy JRuby applications in trial accounts|deploy-jruby-trial]].
###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|http://support.cloud.engineyard.com]] 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.)
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
-
Install JRuby.
rvm install jruby rvm jruby
-
Verify that you have installed Bundler 1.0.10 or later.
bundle -v
-
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-mysql', :require => false gem 'jdbc-sqlite3', :require => false end
-
Run these commands to update your Gemfile.lock:
bundle install git commit -a -m "Gemfile updated for JRuby/Trinidad" git push origin
-
(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
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
-
In your Dashboard, create an application.
-
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). -
Deploy the application.
For more information about... | See... |
---|---|
JRuby | [[jruby.org|http://jruby.org/]] |
configuring Trinidad | [[Advanced configuration|https://github.com/trinidad/trinidad/wiki/advanced-configuration]] |
the Engine Yard CLI | [[Engine Yard CLI User Guide|ey_cli_user_guide]] |
Bundler | [[Bundler tips|bundler-tips-for-cloud]] |