Project

General

Profile

Glassfish 1.3 + Redmine 1.1.2 + JRuby 1.6.1 + Postgres 9.0 Guide (working)

Added by Ben Siroshton over 13 years ago

Here is a guide for those that might find it useful to install redmine onto glassfish with the versions mentioned above. Please disregard (or delete) my previous topic for this.

Thanks.

-=ben

--------------------------------------------------------------------------------
Installing Redmine on Glassfish with PostgreSQL
--------------------------------------------------------------------------------
This is a quick guide on getting redmine working with glassfish and posgresql.
Author: Ben Siroshton
04/15/2011

--------------------------------------------------------------------------------
Versions I used at the time of writing
-------------------------------------------------------------------------------
Postgresql 9.0
Glassfish 3.1
Redmine 1.1.2
JRuby 1.6.1

jruby -S gem list

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-jdbc-adapter (1.1.1)
activeresource (2.3.5)
activesupport (2.3.5)
bouncy-castle-java (1.5.0145.2)
i18n (0.4.2)
jdbc-postgres (9.0.801)
jruby-jars (1.6.1)
jruby-openssl (0.7.3)
jruby-rack (1.0.8)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rubyzip (0.9.4)
sources (0.0.1)
warbler (1.2.1)

-------------------------------------------------------------------------------
Steps
-------------------------------------------------------------------------------

- Install Glashfish

- Download the latest jruby and copy this someplace, add its "bin" folder
to your path.

- Create new user in postgres "redmine" and for sake of this document
the password "redmine"

- Create new database "redmine" and make the user "redmine" the owner

- Copy the posgresql jdbc driver to these folders:
1> [glassfish install]/glassfish/lib

- Download and Extract Redmine

- Open command prompt and go to Redmine folder

- Type the following commands
1> jruby -S gem install -v=0.4.2 i18n
2> jruby -S gem install jdbc-postgres
3> jruby -S gem install jruby-openssl
4> jruby -S gem install warbler

If running jruby 1.6.1 also this:
5> jruby -S gem install activerecord-jdbc-adapter
6> jruby -S gem install -v=2.3.5 rails

- Edit the file config/database.yml. Clear the file and add these lines (dont
use tabs):

----vv---------- copy ----------vv----
#production:
  1. adapter: jdbc
  2. jndi: jdbc/redmine
  3. driver: org.postgresql.Driver

production:
adapter: postgresql
database: redmine
host: localhost
username: redmine
password: redmine
encoding: utf8
port: 5432

----^^---------- copy ----------^^----

- Now to patch redmine 1.1.2, edit config/environment.rb and add this after
the first "require" line (near the top):

----vv---------- copy ----------vv----
if Gem::VERSION >= "1.3.6"
module Rails
class GemDependency
def requirement
r = super
(r == Gem::Requirement.default) ? nil : r
end
end
end
end
----^^---------- copy ----------^^----

- Now type these commands from the redmine folder:
1> jruby -S rake generate_session_store
2> jruby -S rake db:migrate RAILS_ENV=production
3> jruby -S rake redmine:load_default_data RAILS_ENV=production

- Edit the config/database.yml and reverse the commented secitions out. The
upper portion will now be uncommented and the lower portion will be commented.

- Execute:
1> jruby -S warble config

- Next edit the file config/warble.rb add add the line:

config.gems["rack"] = "1.0.1"
Also search for "jruby-openssl" and uncomment that line and remove the
active record portion so it looks like this:
config.gems += ["jruby-openssl"]

- Now we can build the war file for deployment, type:
1> jruby -S warble

- Next, go to glassfish and add the redmine connection pool and jdbc resource
to match what we put in the database.yml file.

- Go to the glassfish System properties
[Configurations->server-config->Server Properties] and add a new property
"jruby.home" and set its value to wherever you placed jruby, be sure to use
forward slashes for your path.

- Deploy redmine onto glassfish, with any luck you made it without any errors.

--------------------------------------------------------------------------------
References:
http://karanar.net/?p=265
http://www.redmine.org/issues/7516
http://www.redmine.org/boards/2/topics/10334
--------------------------------------------------------------------------------


Replies (2)

RE: Glassfish 1.3 + Redmine 1.1.2 + JRuby 1.6.1 + Postgres 9.0 Guide (working) - Added by Ben Siroshton over 13 years ago

Argh.. I spoke too soon, turns out redmine has issues with postgres. Everything appears to be fine on the surface until you click a project, once you do you get the error outlined here: http://www.redmine.org/boards/1/topics/19434?r=23384#message-23384

-=ben

RE: Glassfish 1.3 + Redmine 1.1.2 + JRuby 1.6.1 + Postgres 9.0 Guide (working) - Added by Ben Siroshton over 13 years ago

As a side note, using MySQL with the guide above is working without problems.

-=ben

    (1-2/2)