Standalone JRuby Application with ActiveRecord

11 April 2016 by Gaurav Gaglani No comments

This is in continuation to the post I had previously published Standalone Ruby Project with ActiveRecord.There was an application where we were working on and it needed to scale. So, we moved our application to JRuby tuned it for scalability. Thus wanted to share the information.

Let’s convert our existing ruby application to a JRuby standalone application. Actually to do this there are a few steps, involved. Let’s create a new branch from the standalone ruby project we had created. Lets check out the a new branch.

Setup the environment:

Install the bundler gem.

Dependencies:

We need to update the dependencies, we will go to, standalone_app.gemspec adding the following dependencies.

spec.add_development_dependency "jdbc-mysql"
spec.add_development_dependency "activerecord-jdbc-adapter"
spec.add_development_dependency "activerecord"

Then add the Ruby Version to the Gemfile. We will just confirm that JRuby is installed correctly.

 

Lets install our dependencies

 

Next Steps:

If you are creating an application from scratch please refer the Standalone ruby application with ActiveRecord for getting the rake tasks and application tasks working. Please make you remove the require 'mysql2' from the stanalone_app/Rakefile and standalone_app/lib/standalone_app.rb. Please find the source code on GitHub.

Gaurav Gaglani

Follow me on Twitter

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe To Our Blog

Get access to proven marketing ideas, latest trends and best practices.

Next up home

Contact

Lets build cool stuff

Share your contact information & we will get in touch!

I want (Tell us more about your dream project)