Introduction
In this tutorial I will explain how to install
Redmine 0.8.4 on
GlassFish 2.1 using
JRuby 1.3.1 with MySQL.
Required Software
- Redmine 0.8.4
- GlassFish 2.1
- NetBeans 6.7
- MySQL 5.1
Instructions
- First we will need to download and install JRuby 1.3.1. The binaries can be found on the Kenai site.
- Make sure that your PATH is set to point to your JRuby installation. You can check your install by typing jruby -v at the command prompt. You should see something similar to the listing below.
dev:~ jyeary$ jruby -v
jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_15) [x86_64-java]
- Run from the command line
jruby -S gem update
This will update all of the gems required to run our application.
- Run from the command line
jruby -S gem install jruby-openssl rails mongrel jdbc-mysql activerecord-jdbcmysql-adapter warbler
This will install all of the gems required to run our application.
- Download a copy of Redmine 0.8.4 and unzip it.
- Using NetBeans 6.7.1, check the Tools --> Ruby Platform Manager to make sure that you install the JRuby 1.3.1 platform.
- In NetBeans, create a new Ruby on Rails Application with Existing Sources. Next
- Select the unzipped RoR Redmine application as the project folder.
- Select the JRuby 1.3.1 Platform from the combo-box menu.
- Select Mongrel for the server from the combo-box menu. Click Finish. NetBeans will create the RoR project and install Warbler which will create our war file for deployment on GlassFish.
- We are now ready to configure the application. Follow the instructions for configuring the application here.
- In the redmine-0.8.4 directory run the following command
jruby -S warble config
This will create the configuration file for warbler to build our war file for deployment on GlassFish.
- Edit the warble.rb file and modify the config.dirs line to the following:
config.dirs = %w(app config lib log vendor tmp files lang)
This will make sure that we deploy all of the application relevant files in our war file.
- Edit the warble.rb file and add the following line:
config.gems = ["activerecord-jdbcmysql-adapter"]
This will make sure that when we convert the application to a war file that the appropriate ActiveRecord JDBC drivers for MySQL are added to it.
- Run the application to make sure that it runs correctly on Mongrel.
- Run the following commands to create the war file
jruby -S rake war:clean
jruby -S rake war
- Go to the Administrative Console on GlassFish. Select Web Applications and deploy the new redmine-0.8.4.war file.