8

is there any particular way to convert a Ruby on Rails project to a JRuby on Rails project? There now is a need to get the Rails side to talk to a Java server via RMI so was wondering how to make the conversion. Thanks.

peppermonkey
  • 93
  • 1
  • 3

2 Answers2

7

As @Karl says, it pretty much works but there are a number of caveats you should be aware of:

  • The database adapters will be different from the ones you may be used to. They're based on JDBC. For example, the MySQL adapter install is described here
  • You will generally deploy to Java application servers in production such as Glassfish, Tomcat or Jetty. Typically this is done using Warbler
  • Certain gems with native extensions may not work. See here for details on the what is required
bjg
  • 7,457
  • 1
  • 25
  • 21
  • Great, thanks, this is what I was looking for. Question though, assuming you want to use both Ruby on Rails an JRuby on Rails for different projects, how do you keep the various similar gems separated? – peppermonkey Jul 12 '10 at 18:15
  • @peppermonkey. I would highly recommend the Ruby Version Manager for managing rubies and partitioned gems. See http://rvm.beginrescueend.com/ – bjg Jul 12 '10 at 18:48
2

It pretty much just works, you simply run it with JRuby instead of Ruby.

You might be interested in this though: http://jrubyist.wordpress.com/2009/07/15/jruby-and-sqlite3-living-together/

Karl
  • 6,035
  • 5
  • 30
  • 39
  • Good to know! Will be using a postgresql database behind the scene as opposed to a sqlite but still good to know. Thanks. – peppermonkey Jul 12 '10 at 18:17