JRuby on Rails

From JRubyWiki

Jump to: navigation, search

You can use JRuby with Ruby on Rails!

Contents

About

Running Rails with JRuby rather than Matz' Ruby Interpreter

  1. Gives Rails the power and functionality of Java: Virtual Machine, application servers, and libraries.
  2. With future JVM and JRuby improvements, JRuby may be faster than MRI in running Rails
  3. Gets Rails in the door of Java shops by making Rails apps into Java-platform apps.

Status

See Rails Support

Getting Started

Use gem to install Rails into your JRuby:

1. If behind a firewall, set HTTP_PROXY (format http://${http-proxy-host}:${http-proxy-port}/)

2. Run $JRUBY_HOME/bin/gem install rails -y --no-ri --no-rdoc

The command-line switches are to install all dependencies, [including rake] and to skip the (slow) installation of documentation.

3. Run jruby $JRUBY_HOME/bin/rails <appname> to generate an app

4. From within the app, run jruby script/server

This will get a basic app up and running with WEBrick. See Running Rails with ActiveRecord-JDBC for information about wiring up JDBC as an ActiveRecord adapter.

Plugins tested in real world apps in JRuby

NOTE: Don't be discouraged by this list. This is just meant to put any notes of real world experience. JRuby is generally solid and should be able to support all pure Ruby plugins.

1. Engines
2. Datebocks Engine
3. Active RBAC
4. Acts As Audited
5. Acts As Draftable
6. Acts As Paranoid
7. Scaffolding Extensions
8. File Column Rails Plugin

See Also

Personal tools