Over a million developers have joined DZone.

Heroku Announces JRuby Support, Starting Now

DZone's Guide to

Heroku Announces JRuby Support, Starting Now

· Cloud Zone
Free Resource

MongoDB Atlas is a database as a service that makes it easy to deploy, manage, and scale MongoDB. So you can focus on innovation, not operations. Brought to you in partnership with MongoDB.

This morning, Heroku announced immediate support for JRuby, allowing developers to utilize JVM-based libraries with Ruby syntax. Ruby developers already on Heroku can now use JRuby to run multiple threads of code in one process and take advantage of optimized Java libraries.

Heroku provides the following instructions for those starting from scratch with JRuby:

All you need to do is specify the version of Ruby you want to run, the engine, and the engine version in your Gemfile:

ruby '1.9.3', engine: 'jruby', engine_version: '1.7.1'

You'll need to run bundle install with JRuby locally, then commit the results and push to Heroku:

$ git add .
$ git commit -m "trying JRuby on Heroku"
$ git push heroku master
Counting objects: 692, done.
Delta compression using up to 4 threads. Compressing objects: 100% (662/662), done.
Writing objects: 100% (692/692), 141.01 KiB, done. Total 692 (delta 379), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Using Ruby version: ruby-1.9.3-jruby-1.7.1
-----> Installing JVM: openjdk7-latest
-----> Installing dependencies using Bundler version 1.2.1 # ...

Heroku also provides instructions for moving existing rails apps to JRuby.

JRuby support is live now, so you can get git-pushing immediately if you like. And if you do, let us know what you think of the experience.

MongoDB Atlas is the best way to run MongoDB on AWS — highly secure by default, highly available, and fully elastic. Get started free. Brought to you in partnership with MongoDB.


Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}