A Brief Introduction to JRuby on Rails with Grizzly

| | コメント(0)

1. Install JRuby and Rails

  • Download JRuby from http://dist.codehaus.org/jruby/
    $ wget http://dist.codehaus.org/jruby/jruby-bin-1.0.1.zip
  • Unzip JRuby to your favorite directory (e.g. /usr/local).
    $ cd /usr/local
    $ sudo unzip ~/jruby-bin-1.0.1.zip
  • Set environment variable JRUBY_HOME to point JRuby directory.
    $ export JRUBY_HOME=/usr/local/jruby-1.0.1
    $ export PATH=$PATH:$JRUBY_HOME/bin
  • Install rails from command line.
    $ jruby -S gem install rails -y --no-ri --nor-rdoc

2. Prepare Rails App

  • Generate Rails application to yoru favorite directory.
    $ jruby -S rails my-app
  • Install dependency libraries to your Rails dir.
    $ jruby -S rake rails:freeze:gems

3. Setup JRuby on Rails with Grizzly

  • Download and unzip JRuby on Rails with Grizzly.
    $ wget http://download.java.net/maven/2/com/sun/grizzly/bundles/grizzly-jruby-webserver-1.6.0.zip
    $ unzip grizzly-jruby-webserver-1.6.0.zip
  • Run grizzly server.
    $ cd grizzly-jruby-webserver-1.6.0
    $ java -Xmx512m -server -Djruby.jit.enabled=true -Djruby.objectspace.enabled=false -jar jruby-1.6.0.jar -n 3 ~/my-app

FAQ

Q: I got "no implicit conversion from nil to integer (TypeError)". Why?
A: You may forget "rake rails:freeze:gems" in your Rails directory.

コメントする

著者について

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

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

タグクラウド

ウェブページ

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