krunal shah
krunal shah

Reputation: 16339

Where to start for Jruby on rails?

Any tutorials or blog are available to start with JRuby on Rails
which guide me to the installation and small JRuby on Rails application ? I have gone through this Walkthroughs And Tutorials(https://github.com/jruby/jruby/wiki/WalkthroughsAndTutorials) link but most of the JRuby on Rails links are broken.

Upvotes: 6

Views: 4976

Answers (1)

JRuby and Rails Installation

The easiest way to set up JRuby is using rvm. The following command installs rvm, the latest version if JRuby, and gets the latest version of rails:

$ curl -L https://get.rvm.io | bash -s stable --autolibs=3 --ruby=jruby --gems=rails

On Windows, you can download an installer which will set up JRuby for you. You then need to install rails by running the following command:

jruby -S gem install rails

Set up a Rails project

JRuby’s wiki page JRuby on Rails is a great collection of resources on the topic; it contains in particular a link to that good blog post: http://blog.rubyrockers.com/2011/03/rails3-application-jruby/

In a nutshell, to create a rails project based on JRuby, use the following command, replacing my_app with the name of your project:

rails new my_app -m https://www.jruby.org/templates/default.rb

Rails Development

Once your project is set up, any Rails 3 tutorial will do — it is Ruby after all!

Deployment

For deployment, have a look at:

  • “specific” solutions like Torquebox or Trinidad,
  • or warbler to package your app as a war and deploy in traditional Java app server (WebSphere, Weblogic, etc.).

Further Resources

Finally, it is also worth mentioning that Charles Nutter et al's book Using JRuby has a chapter dedicated to JRuby on Rails, and is an invaluable help in JRuby developments.

Upvotes: 10

Related Questions