Miles to go …

May 28, 2008

JRuby 1.1.2 released – Getting Started with v3 Gem

Filed under: web2.0 — arungupta @ 11:45 pm

JRuby 1.1.2 was released yesterdaydownload 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

~/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

~/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 …

~/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 Redmine) …

~/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 previously deployed Redmine application, now on the GlassFish gem:

Simple isn’t it ?

If your Rails application does not work on the gem, file bugs here with “jruby” as “subcomponent” (default version is “v3″).

Alternatively, you can download GlassFish v3 TP2 and 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 TOTD #27.

Technorati: jruby ruby rubyonrails glassfish v3 gem redmine netbeans webtier

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • email
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Related posts:
  1. JRuby 1.1.3 released – Getting Started with GlassFish
  2. TOTD #24: Getting Started with Rails 2.0.x in JRuby 1.0.3 and JRuby 1.1RC1
  3. JRuby 1.0.2 released – Improved Windows experience and Rails 1.2.5 support
  4. JRuby 1.1 released – ready for production!
  5. JRuby 1.1 RC3 released – Last chance to file bugs

4 Comments »

  1. Thanks for help!

    Comment by Website Design Melbourne — May 29, 2008 @ 4:25 am

  2. Hi Arun,

    thank you for your work and clear tutorial.

    I’ve got some problem uploading files with multipart form.

    I’am using:
    JRuby 1.1.2
    glassfish 0.2
    image_voodoo 0.2

    When i try to upload files simply the application do not respond for several seconds an then abort the action (but no crash).

    Any ideas?
    Thank you
    MIchele

    Comment by Michele Costa — June 18, 2008 @ 5:50 am

  3. [Trackback] Vivek released 0.3.0 version of GlassFish Gem for Rails (a total of 11 issues fixed and resolved – RubyForge & GlassFish Issue Tracker) earlier. But that caused a regression on #4228. And so matching the agility expected by Rails developers, h…

    Comment by Arun Gupta's Blog — June 25, 2008 @ 6:42 am

  4. Michele, This was filed as an issue at:

    https://glassfish.dev.java.net/issues/show_bug.cgi?id=5160

    and now fixed with the latest Gem release. Can you try it and let us know ?

    Comment by Arun Gupta — June 26, 2008 @ 5:35 pm

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