Miles to go …

May 23, 2008

Redmine on GlassFish – Ruby-on-Rails Project Management Application

Filed under: web2.0 — arungupta @ 6:00 am


Redmine
is a flexible project management web application written using Ruby on Rails framework. The feature list is pretty comprehensive from the usual suspects like multiple projects, role-based control, forums/wikis/SCM for each project to enterprise level features such as LDAP-authentication and multiple languages. It is cross-platform and cross-database and deploys very nicely on GlassFish v3.

GlassFish v3 modularity and extensibility allows Rails applications to be deployed without any modification (no WARing). This blog explains the steps on how to deploy Redmine on GlassFish and shows some screenshots later. More documentation is available in Redmine Guide.

  1. Check out the most stable release of Redmine by giving the command:

    ~/testbed/redmine >svn co http://redmine.rubyforge.org/svn/branches/0.7-stable redmine-0.7
  2. Configure the database
    1. Start your MySQL server 

      ~/testbed/redmine >sudo mysqld_safe –user root
      Starting mysqld daemon with databases from /usr/local/mysql/data
    2. Create the database as:
      ~/testbed/redmine/redmine-0.7 >../jruby-1.1.1/bin/jruby -S rake db:create
      (in /Users/arungupta/testbed/redmine/redmine-0.7)
    3. Migrate the database as:
      ~/testbed/redmine/redmine-0.7 >../jruby-1.1.1/bin/jruby -S rake db:migrate
      (in /Users/arungupta/testbed/redmine/redmine-0.7)
      == 1 Setup: migrating =========================================================
      — create_table(“attachments”, {:force=>true})
         -> 0.2840s
      — create_table(“auth_sources”, {:force=>true})
         -> 0.0540s
      — create_table(“custom_fields”, {:force=>true})
         -> 0.0430s
      — create_table(“custom_fields_projects”, {:id=>false, :force=>true})
         -> 0.0080s
      — create_table(“custom_fields_trackers”, {:id=>false, :force=>true})
         -> 0.0500s

      . . .

      == 90 ChangeVersionsNameLimit: migrating ======================================
      — change_column(:versions, :name, :string, {:limit=>nil})
         -> 0.0220s
      == 90 ChangeVersionsNameLimit: migrated (0.0220s) =============================

      == 91 ChangeChangesetsRevisionToString: migrating =============================
      — change_column(:changesets, :revision, :string, {:null=>false})
         -> 0.0210s
      == 91 ChangeChangesetsRevisionToString: migrated (0.0230s) ====================

      == 92 ChangeChangesFromRevisionToString: migrating ============================
      — change_column(:changes, :from_revision, :string)
         -> 0.0130s
      == 92 ChangeChangesFromRevisionToString: migrated (0.0150s) ===================

  3. Download, Install and Configure GlassFish v3
    1. Download GlassFish v3 from here.
    2. Unzip the downloaded bundle.
    3. Add the following fragment as the last line in “glassfishv3-tp2/glassfish/config/asenv.conf” file:
      JRUBY_HOME=”/Users/arungupta/testbed/redmine/jruby-1.1.1″
  4. Deploy Redmine as:
    ~/testbed/redmine >./glassfishv3-tp2/glassfish/bin/asadmin deploy redmine-0.7
    Command deploy executed successfully.

    … and the GlassFish console shows:

    May 21, 2008 4:58:30 PM com.sun.enterprise.rails.RailsDeployer registerAdapter
    INFO: Loading application redmine-0.7 at /redmine-0.7
    May 21, 2008 4:58:30 PM 
    INFO: Starting Rails instances
    May 21, 2008 4:58:37 PM 
    SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    May 21, 2008 4:58:42 PM com.sun.grizzly.jruby.RubyObjectPool$1 run
    INFO: Rails instance instantiation took : 11979ms
    May 21, 2008 4:58:42 PM com.sun.enterprise.v3.deployment.DeployCommand execute
    INFO: Deployment of redmine-0.7 done is 12091 ms

That’s it, your application is ready to be used! Here are some screen snapshots from my trial run:


Rails powered by the GlassFish Application Server provides all the good reasons on why you should consider using GlassFish instead of the traditional deployment models for Ruby-on-Rails applications.

This application is also covered in LAB 5539 as part of FREE 20-week Ruby-on-Rails course by Sang “with Passion” Shin.

Technorati: web2.0 rubyonrails jruby ruby glassfish redmine

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Related posts:
  1. TOTD # 74: JRuby and GlassFish Integration Test #5: JRuby 1.2.0 RC2 + Rails 2.x.x + GlassFish + Redmine
  2. Substruct on GlassFish v3 – Ruby-on-Rails E-Commerce Application
  3. TOTD #104: Popular Ruby-on-Rails applications on GlassFish v3 – Redmine, Typo, Substruct
  4. TOTD #37: SQLite3 with Ruby-on-Rails on GlassFish Gem
  5. Typo on GlassFish v3 – Ruby-on-Rails Blogging Engine

18 Comments »

  1. You rocks ! Thank for doing this ! It’s have been in my to do list but never got to execute it.

    Comment by TK — May 23, 2008 @ 9:43 am

  2. [Trackback] JRuby 1.1.2 is now released – download here! The highlights are: Startup time drastically reduced YAML symbol parsing >100x faster Performance, threading, and stack depth improvements for method calls Fixed several nested backref problems Fixed bad…

    Comment by Arun Gupta's Blog — May 29, 2008 @ 7:16 am

  3. Thanks for the information. However I’m curious to know what is benefit of deploying a Rails Application in Glassfish ? Or in other words why should one consider deploying their Rails app in Glassfish ?

    Comment by Andy Yasuna — June 2, 2008 @ 10:48 am

  4. Andy, http://developers.sun.com/appserver/reference/techart/rails_gf/ describes exactly the set of reasons why Rails need to be powered by the GlassFish application server.

    Comment by Arun Gupta — June 4, 2008 @ 2:45 pm

  5. hi Arun,

    thanks for creating this page, it is very helpful !

    When I follow your steps to deploy redmine 0.7 to glassfish v3, I got this error, do u know why?

    /Users/mei/Downloads/glassfishv3-tp2/glassfish/bin/asadmin deploy redmine-0.7FAILURE : Failed to load com.sun.enterprise.rails.RailsSniffer from ModuleClassLoader(name=org.glassfish.extras:gf-jruby-connector, parent=,URls[]=file:/Applications/glassfishv3-tp2/glassfish/modules/gf-jruby-connector-10.0-tp-2-SNAPSHOT.jar,),init=true,URls[]=file:/Applications/glassfishv3-tp2/glassfish/modules/gf-jruby-connector-10.0-tp-2-SNAPSHOT.jar,)
    Command deploy failed.

    Comment by mei — July 17, 2008 @ 10:51 am

  6. I see the above mentioned error when I used this command to deploy the app /Users/mei/Downloads/glassfishv3-tp2/glassfish/bin/asadmin deploy redmine-0.7

    but I don’t see the error when I used this command:

    /Users/mei/Downloads/jruby-1.1.2/bin/jruby -S glassfish_rails redmine-0.7

    so it would be a bug in GF.

    Comment by Mei — July 17, 2008 @ 11:21 am

  7. Mei,

    I followed the steps and could deploy easily. Here is the log that I saw:

    INFO: Loading application redmine-0.7 at /redmine-0.7
    Jul 17, 2008 4:56:14 PM
    INFO: Starting Rails instances
    Jul 17, 2008 4:56:16 PM
    SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support.
    http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
    Jul 17, 2008 4:56:21 PM com.sun.grizzly.jruby.RubyObjectPool$1 run
    INFO: Rails instance instantiation took : 6967ms
    Jul 17, 2008 4:56:21 PM com.sun.enterprise.v3.deployment.DeployCommand execute
    INFO: Deployment of redmine-0.7 done is 6977 ms

    Here is how I start v3:

    java -DJRUBY_HOME=/Users/arungupta/testbed/rails202/jruby-1.1.2 -jar modules/glassfish-10.0-tp-2-SNAPSHOT.jar

    Are you using GlassFish v3 TP2 or trunk ?

    Is it Rails 2.0.2 or 2.1 ?

    Comment by Arun Gupta — July 17, 2008 @ 3:57 pm

  8. Hi Arun,

    I’m using Rails 2.0.2 and GF V3 TP2, not the trunk.

    The failing only happens when I used the asadmin deploy command.

    e.g. /Users/mei/Downloads/glassfishv3-tp2/glassfish/bin/asadmin deploy redmine-0.7

    It works fine if I use the following command to deploy

    /Users/mei/Downloads/jruby-1.1.2/bin/jruby -S glassfish_rails redmine-0.7

    Thanks,

    Mei

    Comment by mei — July 22, 2008 @ 11:25 am

  9. [Trackback] Typo is an open-source Blogging Engine written using Ruby-on-Rails framework. It provides a lean engine that makes blogging easy. It’s main attribtues are ease of use, usability, beauty and excellent support of web standards. I found out about this…

    Comment by Arun Gupta's Blog — August 28, 2008 @ 5:50 am

  10. [Trackback] Typo is an open-source Blogging Engine written using Ruby-on-Rails framework. It provides a lean engine that makes blogging easy. It’s main attribtues are ease of use, usability, beauty and excellent support of web standards. I found out about this…

    Comment by Arun Gupta's Blog — August 28, 2008 @ 5:57 am

  11. Thanks for the information. However I’m curious to know what is benefit of deploying a Rails Application in Glassfish ? Or in other words why should one consider deploying their Rails app in Glassfish ?

    Comment by wow gold — March 12, 2009 @ 12:34 am

  12. http://developers.sun.com/appserver/reference/techart/rails_gf/ describes the advantages of using GlassFish for running Rails applications.

    Comment by Arun Gupta — March 12, 2009 @ 6:17 pm

  13. [Trackback] TOTD #70, #71, #72, #73 shows four integration tests that can ensure that the latest JRuby and GlassFish versions work nicely with each other. #70 showed how to create a trivial Rails application and run it using GlassFish Gem. #71…

    Comment by Arun Gupta's Blog — March 16, 2009 @ 11:49 am

  14. [Trackback] TOTD #70, #71, #72, #73 shows four integration tests that can ensure that the latest JRuby and GlassFish versions work nicely with each other. #70 showed how to create a trivial Rails application and run it using GlassFish Gem. #71…

    Comment by Arun Gupta's Blog — March 16, 2009 @ 11:53 am

  15. Great doc, I have one question though:
    How can you set the environment variable (e.g.: production, development, test)? With this tutorial the redmine always starts in development mode…
    Thanks!

    Comment by Peter Major — December 1, 2009 @ 4:02 pm

  16. Peter,

    Just include RAILS_ENV=production at the CLI to change the environment.

    Comment by Arun Gupta — February 23, 2010 @ 5:05 pm

  17. do you know if the gantt chart works fine?

    thanks

    Comment by Daniel Caro — April 12, 2010 @ 12:58 am

  18. Daniel,

    I’ve heard folks using Redmine in production so seems like the features are working nicely. I’ve not tried Gantt charts personally so can’t comment. Let us know if they don’t work though.

    Comment by Arun Gupta — April 13, 2010 @ 6:14 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress