public
Description: use jetty to run rails projects
Homepage: http://jetty-rails.rubyforge.net
Clone URL: git://github.com/fabiokung/jetty-rails.git
commit  f4d340a2abad813656184db4aac06962705a7005
tree    b990f8fa427314052a1f5fa1384e37f1157ccc84
parent  357f7bce896f8ad055290be627bb86510430b021
name age message
file .gitignore Wed Jun 24 19:39:47 -0700 2009 website upload configuration example (rubyforge) [fabiokung]
file History.txt Wed Jun 24 20:43:47 -0700 2009 fixing version, updating release notes [fabiokung]
file Licenses.txt Sat May 10 10:32:23 -0700 2008 bundled software license info and some usage do... [fabiokung]
file Manifest.txt Wed Jun 24 21:29:59 -0700 2009 removing old files from Manifest [fabiokung]
file PostInstall.txt Wed Apr 30 15:07:00 -0700 2008 first working version. Tested with simple rails... [fabiokung]
file README.rdoc Wed Jun 24 21:29:05 -0700 2009 removing duplicated entry [fabiokung]
file Rakefile Wed Jul 08 17:32:19 -0700 2009 giving up trying platform_specific gem with new... [fabiokung]
file TODO.txt Mon Dec 01 20:11:44 -0800 2008 change-list [fabiokung]
directory bin/ Fri Sep 12 11:59:54 -0700 2008 upgrading to jetty-6.1.11, adding JSP and EL su... [fabiokung]
directory config/ Wed Jun 24 19:57:43 -0700 2009 nomore needed [fabiokung]
directory jetty-libs/ Wed Nov 19 00:13:18 -0800 2008 upgrading jetty to 6.1.14 [fabiokung]
file jetty-rails.gemspec Wed Jun 24 21:29:59 -0700 2009 removing old files from Manifest [fabiokung]
directory lib/ Wed Jun 24 20:43:47 -0700 2009 fixing version, updating release notes [fabiokung]
directory script/ Wed Jun 24 19:43:43 -0700 2009 new versions [fabiokung]
directory spec/ Wed Jun 24 20:09:07 -0700 2009 last modifications to use new newgem stuff [fabiokung]
directory tasks/ Wed Jun 24 21:03:35 -0700 2009 removing old rake tasks [fabiokung]
directory website/ Wed Jun 24 19:51:39 -0700 2009 updating newgem [fabiokung]
README.rdoc

jetty-rails

jetty-rails.rubyforge.net

DESCRIPTION:

Jetty Rails aims to run Ruby on Rails and Merb applications with the Jetty Container, leveraging the power of JRuby and jruby-rack.

Jetty is an excellent Java Web Server, being and at the same time extremely lightweight. This makes jetty-rails a good alternative for JRuby on Rails or Merb development and deployment.

The project has born from my own needs (read more). I needed to run JForum in the same context of my JRuby on Rails application. I had also to integrate HttpSessions (avoiding single sign on) and use ServletContext in-memory cache store.

FEATURES:

  • Uses JRuby Rack.
  • Loads all jars inside your application lib/ dir, by default.
  • Loads all classes inside your application classes/ dir, by default.
  • Supports rails and merb applications out of the box.

KNOWN ISSUES

  • Doesn’t work with gems inside $HOME/.gem, because jruby-rack overwrites custom gem paths. Please install jruby in writable places, or install your gems with sudo jruby -S gem install NAME.
  • Doesn’t work with JRuby 1.1.4: jira.codehaus.org/browse/JRUBY-2959
  • To generate coverage report with jruby (>= 1.1) follow instructions from www.ruby-forum.com/topic/146252 and run (inside jetty-rails root dir):

jruby -S rake rcov

  • Hoe in jruby has an issue reading the ~/.hoerc file. Just remove it.

USAGE:

Rails:

  cd myrailsapp
  jruby -S jetty_rails

help option shows usage details:

  jruby -S jetty_rails --help

Merb:

  cd mymerbapp
  jruby -S jetty_merb

help option shows usage details:

  jruby -S jetty_merb --help

REQUIREMENTS:

jetty-rails requires jruby (>=1.1). Please make sure you already have it properly installed and inserted in your PATH environment variable.

Installing JRuby Instructions

INSTALL:

  jruby -S gem install jetty-rails

BUGS AND NEW FEATURES

Using Lighthouse: fabiokung.lighthouseapp.com/projects/12666-jetty-rails

MULTIPLE SERVERS:

You can specify a configuration yaml file rather than command line switches. The file also allows specifying multiple servers and / or application contexts for single jetty container.

For example, you could set a context_path of /testA on port 8888 which is rails, /testB also that port which is merb. Or, you could have /testA on port 8888 and /testB on port 9999.

 jruby -S jetty_rails -c path/to/config.yml

The configuration options are inherited, so if you specify the environment to be "production" at the top level, then any servers and application context will be "production" unless the choose to override the value.

  • server settings: :port, :jruby_min_runtimes, :jruby_max_runtimes, :thread_pool_max, :thread_pool_min, :acceptor_size
  • application context settings: :context_path, :base, :adapter, :environment, :lib_dir, :gem_path

As part of the configuration you have some control over jruby & jetty.

See spec/config.yml, spec/jetty_rails_sample_1.yml, and spec/jetty_rails_sample_2.yml for more examples.

Rails:

If -c is not specified, by default jetty_rails will look for a config/jetty_rails.yml relative to where it is started.

Don’t forget to add this into your config/environment.rb ActionController::AbstractRequest.relative_url_root = "/testA"

JRuby Configuration

You can tweak the JRuby runtimes per application context:

  jruby_min_runtimes: 1
  jruby_max_runtimes: 2

Jetty Configuration

You can also modify the jetty per server configurations:

Thread pool will define the thread pool available to the jetty server using a QueuedThreadPool.

  thread_pool_max: 40
  thread_pool_min: 1

The acceptor size is the number of acceptor threads available for that server’s channel connector.

  acceptor_size: 20

See the jetty documentation for more information.

LICENSE:

Jetty Rails is distributed under the terms of The MIT License. Copyright © 2008 Fabio Kung <fabio.kung@gmail.com>

Read more details in the bundled +Licenses.txt+ file. There are other pieces of software bundled with jetty-rails. Before using jetty-rails, make sure you agree with all of them.