Skip to main content

JRuby 1.1.2 released - Getting Started with v3 Gem

Posted by arungupta on May 29, 2008 at 7:14 AM PDT



JRuby 1.1.2 is now href="http://www.bloglines.com/blog/ThomasEEnebo?id=52">released - href="http://dist.codehaus.org/jruby/jruby-bin-1.1.2.zip">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 data race (JRUBY-2483)
  • Gazillions of bigdecimal issues fixed
  • 95 issues resolved since JRuby 1.1.1

Getting started is really simple, just follow the steps listed below.



Unzip JRuby
1.1.2 zip bundle
...


cellspacing="2">
~/testbed/
>unzip
~/Downloads/jruby-bin-1.1.2.zip


Archive:  /Users/arungupta/Downloads/jruby-bin-1.1.2.zip

   creating: jruby-1.1.2/

   creating: jruby-1.1.2/bin/

  inflating: jruby-1.1.2/bin/_jrubycleanup.bat 

  inflating: jruby-1.1.2/bin/_jrubyvars.bat 

  . . .

  inflating:
jruby-1.1.2/share/ri/1.8/system/Zlib/crc_table-c.yaml 

  inflating:
jruby-1.1.2/share/ri/1.8/system/Zlib/zlib_version-c.yaml 

  inflating:
jruby-1.1.2/share/ri/1.8/system/created.rid 

  inflating:
jruby-1.1.2/share/ri/1.8/system/fatal/cdesc-fatal.yaml 

~/testbed >



... and then install Rails
and GlassFish
v3 gem
...


cellspacing="2">
~/testbed/jruby-1.1.2
>bin/jruby -S gem
install rails glassfish --no-ri --no-rdoc


JRuby limited openssl loaded. gem install jruby-openssl for full
support.

http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL

Bulk updating Gem source index for: http://gems.rubyforge.org/

Bulk updating Gem source index for: http://gems.rubyforge.org/

Successfully installed activesupport-2.0.2

Successfully installed activerecord-2.0.2

Successfully installed actionpack-2.0.2

Successfully installed actionmailer-2.0.2

Successfully installed activeresource-2.0.2

Successfully installed rails-2.0.2

Successfully installed glassfish-0.2.0-universal-java

6 gems installed



... and verify ...


cellspacing="2">
~/testbed/jruby-1.1.2
>bin/jruby -S gem
list g





*** LOCAL GEMS ***



glassfish (0.2.0)



... and now host any of your Rails application on v3 Gem (such as href="http://www.redmine.org/">Redmine) ...


cellspacing="2">
~/testbed/redmine
>../jruby-1.1.2/bin/jruby
-S glassfish_rails redmine-0.7


May 28, 2008 12:07:19 PM com.sun.enterprise.glassfish.bootstrap.ASMain
main

INFO: Launching GlassFish on HK2 platform

May 28, 2008 12:07:19 PM
com.sun.enterprise.glassfish.bootstrap.ASMainHK2 findDerbyClient

INFO: Cannot find javadb client jar file, jdbc driver not available

May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start

INFO: Listening on port 3000

May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator
configureSSL

WARNING: pewebcontainer.all_ssl_protocols_disabled

May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyEmbeddedHttpConfigurator
configureSSL

WARNING: pewebcontainer.all_ssl_ciphers_disabled

May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start

INFO: Listening on port 3131

May 28, 2008 12:07:20 PM
com.sun.enterprise.v3.services.impl.GrizzlyProxy start

INFO: Listening on port 3838

May 28, 2008 12:07:21 PM
com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter setContextRoot

INFO: Admin Console Adapter: context root: /admin

May 28, 2008 12:07:21 PM com.sun.enterprise.rails.RailsDeployer
registerAdapter

INFO: Loading application redmine-0.7 at /

May 28, 2008 12:07:21 PM 

INFO: Starting Rails instances

May 28, 2008 12:07:26 PM 

SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for
full support.

http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL

May 28, 2008 12:07:32 PM com.sun.grizzly.jruby.RubyObjectPool$1 run

INFO: Rails instance instantiation took : 11481ms

May 28, 2008 12:07:32 PM com.sun.enterprise.v3.server.AppServerStartup
run

INFO: Glassfish v3 started in 12787 ms



Below is the screenshot from a href="http://blogs.sun.com/arungupta/entry/redmine_on_glassfish_ruby_on">previously
deployed Redmine application, now on the GlassFish gem:



href="http://blogs.sun.com/arungupta/resource/ror/jruby112-v3-gem-redmine.png"> style="border: 0px solid ; width: 700px; height: 598px;" alt=""
src="http://blogs.sun.com/arungupta/resource/ror/jruby112-v3-gem-redmine.png">



Simple isn't it ?



If your Rails application does not work on the gem, href="https://glassfish.dev.java.net/issues/enter_bug.cgi?issue_type=DEFECT">file
bugs here with "jruby" as "subcomponent" (default version is
"v3").



Alternatively, you can download href="http://glassfish.org/downloads/v3">GlassFish v3 TP2
and href="http://blogs.sun.com/arungupta/entry/rails_and_java_ee_integration2">deploy
your applications to leverage complete Java EE functionality.



You can also configure JRuby 1.1.2 as a Ruby platform in NetBeans 6.1
as described in href="http://blogs.sun.com/arungupta/entry/totd_27_configurable_multiple_ruby">TOTD
#27.



Technorati: jruby
ruby href="http://technorati.com/tag/rubyonrails">rubyonrails
glassfish
v3 href="http://technorati.com/tag/gem">gem href="http://technorati.com/tag/redmine">redmine href="http://technorati.com/tag/netbeans">netbeans href="http://technorati.com/tag/webtier">webtier

Related Topics >>

Comments

Deploying multiple apps on GlassFish v3 TP2 is a known problem as described at: https://glassfish.dev.java.net/issues/show_bug.cgi?id=5046 Please follow the workaround mentioned in the bug report.

I cannot get JRuby 1.1.2 to work properly with GlassFish v3 TP2 as you suggest. Deploying a single application works fine. However, when a second application is deployed into the same server, there are unexplained routing errors on literally every other page load. I have replicated this problem on two different machines. Here is information concerning my environment: Java 6 SDK JRuby 1.1.2 GlassFish v3 TP2 Rails 2.0.2 I've tried many different ways of doing this. Using Redmine. Using two Rails applications I made myself using JRuby on the host platform. All with the same results. Should I revert to GlassFish v2? Will this work with JRuby 1.1.2? Any suggestions would be greatly appreciated. Here are the GlassFish commands I used: ./asadmin start-domain ./asadmin deploy [app name] ./asadmin undeploy [app name] Thank you for your blog. It is a great resource for GlassFish and JRuby on Rails (despite my frustration)!