How to deploy JRuby on Rails app to Glassfish.

| | コメント(0)

This document is outdated.

0. apply patch to appserv-webtier.
Jeanfrancois has committed a patch. Thanks!

### Eclipse Workspace Patch 1.0
#P appserv-webtier
Index: src/java/org/apache/tomcat/util/buf/MessageBytes.java
===================================================================
RCS file: /cvs/glassfish/appserv-webtier/src/java/org/apache/tomcat/util/buf/MessageBytes.java,v
retrieving revision 1.4
diff -u -r1.4 MessageBytes.java
--- src/java/org/apache/tomcat/util/buf/MessageBytes.java	30 Oct 2006 23:34:53 -0000	1.4
+++ src/java/org/apache/tomcat/util/buf/MessageBytes.java	17 Nov 2006 13:27:09 -0000
@@ -310,6 +310,8 @@
      * @return true if the comparison succeeded, false otherwise
      */
     public boolean equals(String s) {
+        if( s == null )
+            return false;
 	if( ! caseSensitive )
 	    return equalsIgnoreCase( s );
 	switch (type) {

1. Copy follow files to <install_dir>/lib
* jruby-0.9.1.jar
* rails-module-0.1-SAPSHOT.jar (download binary or download source)

2. Edit <install_dir>/domains/<domain_name>/conf/domain.xml

<http-listener id="http-listener-1" address="0.0.0.0" port="8080" acceptor-threads="1" security-enabled="false" default-virtual-server="server" server-name="" xpowered-by="true" enabled="true">
  <property name="selectorThreadImpl" value="com.sun.grizzly.rails.RailsSelectorThread"/>

3. create config file to <install_dir>/domains/<domain_name>/conf/rails.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
  <comment>Glassfish JRuby on Rails module</comment>
  <entry key="jruby.base">/usr/local/jruby</entry>
  <entry key="jruby.home">/usr/local/jruby</entry>
  <entry key="jruby.lib">/usr/local/jruby/lib</entry>
  <entry key="rails.root">/usr/local/glassfish/domains/domain1/applications/rails</entry>
</properties>

4. generate rails app to <install_dir>/domains/<domain_name>/applications/rails

コメントする

著者について

高井直人
高井 直人
takai@recompile.net

ソフトウェアエンジニア。1977年横浜生まれ。大学在学中からネットワークや情報技術にたずさわる。Web制作会社などを経て、現在はシステムインテグレータに勤務。エンタープライズRubyをテーマに社内標準の策定などに従事している。

タグクラウド

ウェブページ

Powered by Movable Type 4.1-en-release-26-r1141-20080104