JRuby Rails3 Trinidad/Jetty_Rails fails on simplest install - feeling as dim as a 2watt bulb

Ok. This is a tad long, but may be useful for other people trying to do
the same thing.

It’s also on
http://stackoverflow.com/questions/4941151/jruby-rails3-trinidad-jetty-rails-fails-on-simplest-install-feeling-as-dim-as-a

Ok. Been getting quite frustrated trying to get JRuby/Rails3 running
with jetty and tomcat.
Trying to get a local install of jruby/rails3 and jetty/tomcat app
running on OS-X.
(And eventually to an Ubuntu stage and live server)
The error I always get on startup is

Could not find activerecord-jdbc-adapter-1.1.1 in any of the sources
Try running `bundle install`.

I’ve tried googling myself to distraction trying to find out why this
happens. One source mentioned an issue with ‘bundler’ but didn’t give
any version information. Most others gave varying options to change the
Gemfile which I have tried exhaustively for the last 5 hours with no
luck.

In exasperation I decided to start from scratch with a plain install.

Installed jruby in /opt/jruby-1.6.0.RC1/ with symlink for /opt/jruby.
Gems installed:

jruby -S gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.3, 2.3.5)
actionpack (3.0.3, 2.3.5)
activemodel (3.0.3)
activerecord (3.0.3, 2.3.5)
ActiveRecord-JDBC (0.5)
activerecord-jdbc-adapter (1.1.1)
activerecord-jdbcmysql-adapter (1.1.1)
activeresource (3.0.3, 2.3.5)
activesupport (3.0.3, 2.3.5)
arel (2.0.8, 2.0.7, 2.0.6)
bouncy-castle-java (1.5.0145.2)
builder (2.1.2)
bundler (1.0.10)
daemon_controller (0.2.5)
erubis (2.6.6)
fastthread (1.0.7)
file-tail (1.0.5)
gem_plugin (0.2.3)
htmlentities (4.2.4)
i18n (0.5.0)
jdbc-mysql (5.1.13)
jetty-rails (0.8.1)
jruby-jars (1.5.6)
jruby-openssl (0.7.3)
jruby-rack (1.0.5)
mail (2.2.15, 2.2.12)
mime-types (1.16)
mongrel (1.1.5 java)
nokogiri (1.4.1 java)
passenger (3.0.2)
polyglot (0.3.1)
rack (1.2.1, 1.0.1)
rack-mount (0.6.13)
rack-test (0.5.7, 0.5.6)
rails (3.0.3, 2.3.5)
railties (3.0.3)
rake (0.8.7)
ruby-mp3info (0.6.13)
rubyzip (0.9.4)
sources (0.0.1)
spruz (0.2.5)
thor (0.14.6)
treetop (1.4.9)
trinidad (1.0.5)
trinidad_jars (1.0.0)
tzinfo (0.3.24, 0.3.23)
warbler (1.2.1)

As you can see I have installed quite a few gems to get this working.
Sigh… Might be the ActiveRecord-JDBC?

Anyway, go to dev folder:

cd ~/dev_folder
jruby -S rails new test_app --database mysql --template 

…the normal create/apply/gsub output…
cd test_app
bundle install
…normal bundle output…
Using activerecord (3.0.3)
Using activerecord-jdbc-adapter (1.1.1)
Using activeresource (3.0.3)
Using bundler (1.0.10)
Using jdbc-mysql (5.1.13)
…rest of bundle output…

Now start trinidad for example:

jruby -S trinidad
Feb 9, 2011 1:36:13 PM org.apache.coyote.AbstractProtocolHandler 

init
INFO: Initializing ProtocolHandler [“http-bio-3000”]
Feb 9, 2011 1:36:13 PM org.apache.catalina.core.StandardService
startInternal
INFO: Starting service Tomcat
Feb 9, 2011 1:36:13 PM org.apache.catalina.core.StandardEngine
startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.6
Feb 9, 2011 1:36:13 PM org.apache.catalina.startup.ContextConfig
webConfig
INFO: No global web.xml found
Feb 9, 2011 1:36:15 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: using runtime pool timeout of 30 seconds
Feb 9, 2011 1:36:15 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: received min runtimes = 1
Feb 9, 2011 1:36:15 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: received max runtimes = 5
Could not find activerecord-jdbc-adapter-1.1.1 in any of the sources
Try running bundle install.
Exception in thread “JRuby-Rack-App-Init-0”
org.jruby.exceptions.MainExitException: aborted
Feb 9, 2011 1:36:45 PM org.apache.coyote.AbstractProtocolHandler
start
INFO: Starting ProtocolHandler [“http-bio-3000”]
^C

Or jetty_rails:

jruby -S jetty_rails
2011-02-09 13:44:10.122::INFO:  Logging to STDERR via 

org.mortbay.log.StdErrLog
Starting server 3000
2011-02-09 13:44:10.272::INFO: jetty-6.1.14
2011-02-09 13:44:11.045:/:INFO: Info: using runtime pool timeout of
30 seconds
2011-02-09 13:44:11.045:/:INFO: Info: received min runtimes = 1
2011-02-09 13:44:11.045:/:INFO: Info: received max runtimes = 5
Could not find activerecord-jdbc-adapter-1.1.1 in any of the sources
Try running bundle install.
Exception in thread “JRuby-Rack-App-Init-0”
org.jruby.exceptions.MainExitException: aborted
^C

I’m going to re-install jruby in a new folder and install the absolute
minimum gems and try the same thing again.

In the meantime, if anyone has a clue as to why this would be happening
please post, as I’m sure I’m not alone on this one…

Kimbo.

(After the break):

Ah. Hmm. Ok. Here’s a transcript for a complete “from-bare-metal”
install.

I archived my previous jruby install and re-unpacked it from the
tarball, then:

jruby -S gem install rails
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Fetching: activesupport-3.0.4.gem (100%)
Fetching: builder-2.1.2.gem (100%)
Fetching: i18n-0.5.0.gem (100%)
Fetching: activemodel-3.0.4.gem (100%)
Fetching: rack-1.2.1.gem (100%)
Fetching: rack-test-0.5.7.gem (100%)
Fetching: rack-mount-0.6.13.gem (100%)
Fetching: tzinfo-0.3.24.gem (100%)
Fetching: abstract-1.0.0.gem (100%)
Fetching: erubis-2.6.6.gem (100%)
Fetching: actionpack-3.0.4.gem (100%)
Fetching: arel-2.0.8.gem (100%)
Fetching: activerecord-3.0.4.gem (100%)
Fetching: activeresource-3.0.4.gem (100%)
Fetching: mime-types-1.16.gem (100%)
Fetching: polyglot-0.3.1.gem (100%)
Fetching: treetop-1.4.9.gem (100%)
Fetching: mail-2.2.15.gem (100%)
Fetching: actionmailer-3.0.4.gem (100%)
Fetching: thor-0.14.6.gem (100%)
Fetching: railties-3.0.4.gem (100%)
Fetching: bundler-1.0.10.gem (100%)
Fetching: rails-3.0.4.gem (100%)
Successfully installed activesupport-3.0.4
Successfully installed builder-2.1.2
Successfully installed i18n-0.5.0
Successfully installed activemodel-3.0.4
Successfully installed rack-1.2.1
Successfully installed rack-test-0.5.7
Successfully installed rack-mount-0.6.13
Successfully installed tzinfo-0.3.24
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.4
Successfully installed arel-2.0.8
Successfully installed activerecord-3.0.4
Successfully installed activeresource-3.0.4
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.1
Successfully installed treetop-1.4.9
Successfully installed mail-2.2.15
Successfully installed actionmailer-3.0.4
Successfully installed thor-0.14.6
Successfully installed railties-3.0.4
Successfully installed bundler-1.0.10
Successfully installed rails-3.0.4
23 gems installed

Install the other gems:

jruby -S gem install jruby-openssl
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Fetching: bouncy-castle-java-1.5.0145.2.gem (100%)
Fetching: jruby-openssl-0.7.3.gem (100%)
Successfully installed bouncy-castle-java-1.5.0145.2
Successfully installed jruby-openssl-0.7.3
2 gems installed

jruby -S gem install activerecord-jdbc-adapter
Fetching: activerecord-jdbc-adapter-1.1.1.gem (100%)
Successfully installed activerecord-jdbc-adapter-1.1.1
1 gem installed

jruby -S gem install trinidad
Fetching: trinidad_jars-1.0.0.gem (100%)
Fetching: jruby-rack-1.0.5.gem (100%)
Fetching: trinidad-1.0.5.gem (100%)
Successfully installed trinidad_jars-1.0.0
Successfully installed jruby-rack-1.0.5
Successfully installed trinidad-1.0.5
3 gems installed

jruby -S gem install jetty-rails
Fetching: jetty-rails-0.8.1.gem (100%)
PostInstall.txt
Successfully installed jetty-rails-0.8.1
1 gem installed

jruby -S gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.4, 2.3.5)
actionpack (3.0.4, 2.3.5)
activemodel (3.0.4)
activerecord (3.0.4, 2.3.5)
activerecord-jdbc-adapter (1.1.1)
activerecord-jdbcmysql-adapter (1.1.1)
activeresource (3.0.4, 2.3.5)
activesupport (3.0.4, 2.3.5)
arel (2.0.8)
bouncy-castle-java (1.5.0145.2)
builder (2.1.2)
bundler (1.0.10)
erubis (2.6.6)
i18n (0.5.0)
jdbc-mysql (5.1.13)
jetty-rails (0.8.1)
jruby-openssl (0.7.3)
jruby-rack (1.0.5)
mail (2.2.15)
mime-types (1.16)
nokogiri (1.4.1 java)
polyglot (0.3.1)
rack (1.2.1, 1.0.1)
rack-mount (0.6.13)
rack-test (0.5.7)
rails (3.0.4, 2.3.5)
railties (3.0.4)
rake (0.8.7)
ruby-mp3info (0.6.13)
sources (0.0.1)
thor (0.14.6)
treetop (1.4.9)
trinidad (1.0.5)
trinidad_jars (1.0.0)
tzinfo (0.3.24)

jruby -S rails new TestApp --database=mysql --template 

create
create README

blah blah…

create vendor/plugins
create vendor/plugins/.gitkeep
apply http://jruby.org
apply http://jruby.org/templates/default.rb
gsub Gemfile
gsub config/database.yml

cd TestApp
cat Gemfile
source 'http://rubygems.org'

gem 'rails', '3.0.4'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

platforms :ruby do
  gem 'mysql2'
end

platforms :jruby do
  gem 'activerecord-jdbc-adapter'
  gem 'jdbc-mysql', :require => false
end
...blah blah...

cat config/database.yml
...elided...
development:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: TestApp_development
  pool: 5
  username: root
  password:
  socket: /tmp/mysql.sock
...elided...

bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.4)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.4)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.7)
Using tzinfo (0.3.24)
Using actionpack (3.0.4)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.15)
Using actionmailer (3.0.4)
Using arel (2.0.8)
Using activerecord (3.0.4)
Using activerecord-jdbc-adapter (1.1.1)
Using activeresource (3.0.4)
Using bundler (1.0.10)
Using jdbc-mysql (5.1.13)
Using thor (0.14.6)
Using railties (3.0.4)
Using rails (3.0.4)
Your bundle is complete! Use `bundle show [gemname]` to see where a 

bundled gem is installed.

Now create databases:

mysql> CREATE DATABASE TestApp_development DEFAULT CHARACTER SET 

utf8;
Query OK, 1 row affected (0.05 sec)

mysql> CREATE DATABASE TestApp_test DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE DATABASE TestApp_production DEFAULT CHARACTER SET 

utf8;
Query OK, 1 row affected (0.02 sec)

Test with WEBrick:

jruby -S rails server
=> Booting WEBrick
=> Rails 3.0.4 application starting in development on 

http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-02-09 14:40:40] INFO WEBrick 1.3.1
[2011-02-09 14:40:40] INFO ruby 1.8.7 (2011-01-10) [java]
[2011-02-09 14:40:40] INFO WEBrick::HTTPServer#start: pid=25549
port=3000
Started GET “/rails/info/properties” for 0:0:0:0:0:0:0:1%0 at Wed
Feb 09 14:40:43 +1000 2011
SQL (3.0ms) SET SQL_AUTO_IS_NULL=0
Processing by Rails::InfoController#properties as
Rendered inline template (1.0ms)
Completed 200 OK in 269ms (Views: 7.0ms | ActiveRecord: 3.0ms)

Browse to http://localhost:3000/rails/info/properties

Ruby version  1.8.7 (java)
RubyGems version  1.4.2
Rack version  1.2
Rails version  3.0.4
Active Record version  3.0.4
Action Pack version  3.0.4
Active Resource version  3.0.4
Action Mailer version  3.0.4
Active Support version  3.0.4
Middleware
ActionDispatch::Static
Rack::Lock
ActiveSupport::Cache::Strategy::LocalCache
Rack::Runtime
Rails::Rack::Logger
ActionDispatch::ShowExceptions
ActionDispatch::RemoteIp
Rack::Sendfile
ActionDispatch::Callbacks
ActiveRecord::ConnectionAdapters::ConnectionManagement
ActiveRecord::QueryCache
ActionDispatch::Cookies
ActionDispatch::Session::CookieStore
ActionDispatch::Flash
ActionDispatch::ParamsParser
Rack::MethodOverride
ActionDispatch::Head
ActionDispatch::BestStandardsSupport
Application root  /Users/kim/Projects/TestApp
Environment  development
Database adapter  mysql
Database schema version  0

Try trinidad:

jruby -S trinidad
Feb 9, 2011 2:42:05 PM org.apache.coyote.AbstractProtocolHandler 

init
INFO: Initializing ProtocolHandler [“http-bio-3000”]
Feb 9, 2011 2:42:05 PM org.apache.catalina.core.StandardService
startInternal
INFO: Starting service Tomcat
Feb 9, 2011 2:42:05 PM org.apache.catalina.core.StandardEngine
startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.6
Feb 9, 2011 2:42:05 PM org.apache.catalina.startup.ContextConfig
webConfig
INFO: No global web.xml found
Feb 9, 2011 2:42:07 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: using runtime pool timeout of 30 seconds
Feb 9, 2011 2:42:07 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: received min runtimes = 1
Feb 9, 2011 2:42:07 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: received max runtimes = 5
Could not find jdbc-mysql-5.1.13 in any of the sources
Feb 9, 2011 2:42:10 PM org.apache.catalina.core.ApplicationContext
log
SEVERE: Error: unable to initialize application
org.jruby.rack.RackInitializationException: exit
from org/jruby/RubyKernel.java:838:in exit' from /opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/setup.rb:10:in (root)’
from org/jruby/RubyKernel.java:1041:in require' from /opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/setup.rb:34:in require’
from /Users/kim/Projects/TestApp/config/boot.rb:6:in (root)' from org/jruby/RubyKernel.java:1041:in require’
from /Users/kim/Projects/TestApp/config/boot.rb:165:in
load_environment' from file:/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jruby-rack-1.0.5/lib/jruby-rack-1.0.5.jar!/jruby/rack/rails.rb:173:in to_app’
from
file:/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jruby-rack-1.0.5/lib/jruby-rack-1.0.5.jar!/jruby/rack/rails.rb:194:in
new' from <web.xml>:1:in (root)’
from org/jruby/RubyObject.java:1204:in instance_eval' from file:/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jruby-rack-1.0.5/lib/jruby-rack-1.0.5.jar!/vendor/rack-1.2.1/rack/builder.rb:46:in initialize’
from <web.xml>:1:in `(root)’
at
org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:198)
at
org.jruby.rack.PoolingRackApplicationFactory$1.run(PoolingRackApplicationFactory.java:160)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.jruby.exceptions.RaiseException: (SystemExit) exit

Whoops. Missed jdbc-mysql:

jruby -S gem install jdbc-mysql
Successfully installed jdbc-mysql-5.1.13
1 gem installed

jruby -S trinidad
Feb 9, 2011 2:45:03 PM org.apache.coyote.AbstractProtocolHandler 

init
INFO: Initializing ProtocolHandler [“http-bio-3000”]
Feb 9, 2011 2:45:03 PM org.apache.catalina.core.StandardService
startInternal
INFO: Starting service Tomcat
Feb 9, 2011 2:45:03 PM org.apache.catalina.core.StandardEngine
startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.6
Feb 9, 2011 2:45:04 PM org.apache.catalina.startup.ContextConfig
webConfig
INFO: No global web.xml found
Feb 9, 2011 2:45:05 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: using runtime pool timeout of 30 seconds
Feb 9, 2011 2:45:05 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: received min runtimes = 1
Feb 9, 2011 2:45:05 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: received max runtimes = 5
Feb 9, 2011 2:45:13 PM org.apache.catalina.core.ApplicationContext
log
INFO: Info: add application to the pool. size now = 1
Feb 9, 2011 2:45:13 PM org.apache.coyote.AbstractProtocolHandler
start
INFO: Starting ProtocolHandler [“http-bio-3000”]
Feb 9, 2011 2:45:19 PM org.apache.catalina.core.ApplicationContext
log
INFO:

Browse to http://localhost:3000/rails/info/properties and all is ok.

Started GET "/rails/info/properties" for 0:0:0:0:0:0:0:1%0 at Wed 

Feb 09 14:45:19 +1000 2011
Feb 9, 2011 2:45:19 PM org.apache.catalina.core.ApplicationContext
log
INFO: SQL (4.0ms) SET SQL_AUTO_IS_NULL=0
Feb 9, 2011 2:45:19 PM org.apache.catalina.core.ApplicationContext
log
INFO: Processing by Rails::InfoController#properties as
Feb 9, 2011 2:45:20 PM org.apache.catalina.core.ApplicationContext
log
INFO: Rendered inline template (2.0ms)
Feb 9, 2011 2:45:20 PM org.apache.catalina.core.ApplicationContext
log
INFO: Completed 200 OK in 75ms (Views: 9.0ms | ActiveRecord: 4.0ms)

Edit the public index.html and changes are available.

Now try jetty_rails

jruby -S jetty_rails
/opt/jruby-1.6.0.RC1/lib/ruby/site_ruby/1.8/rubygems.rb:242:in 

activate': can't activate activesupport (= 2.3.5, runtime) for [], already activated activesupport-3.0.4 for ["jetty-rails-0.8.1"] (Gem::LoadError) from /opt/jruby-1.6.0.RC1/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:33:in require’
from
/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jetty-rails-0.8.1/lib/jetty_rails.rb:10:in
(root)' from org/jruby/RubyKernel.java:1041:in require’
from
/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jetty-rails-0.8.1/lib/jetty_rails.rb:29:in
require' from /opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jetty-rails-0.8.1/bin/jetty_rails:37:in (root)’
from org/jruby/RubyKernel.java:1066:in `load’

The fix is to edit
/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jetty-rails-0.8.1/lib/jetty_rails.rb:

vi 

/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jetty-rails-0.8.1/lib/jetty_rails.rb

Change this:

require "java"
require "rubygems"
require "activesupport"
require "jetty_rails/jars"

To this:

require "java"
require "rubygems"
#require "activesupport"
require "active_support"
require "active_support/all"
require "jetty_rails/jars"

This should use a rails version if/else but this is a quick fix.

jruby -S jetty_rails
2011-02-09 14:49:45.918::INFO:  Logging to STDERR via 

org.mortbay.log.StdErrLog
Starting server 3000
2011-02-09 14:49:46.131::INFO: jetty-6.1.14
2011-02-09 14:49:46.833:/:INFO: Info: using runtime pool timeout of
30 seconds
2011-02-09 14:49:46.834:/:INFO: Info: received min runtimes = 1
2011-02-09 14:49:46.834:/:INFO: Info: received max runtimes = 5
2011-02-09 14:49:53.122:/:WARN: Error: unable to initialize
application
org.jruby.rack.RackInitializationException: uninitialized constant
Rack::Runtime
from
/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:189:in
tap' from /opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:189:in default_middleware_stack’
from
/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:161:in
app' from /opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application/finisher.rb:35:in (class Finisher)’
from
/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:25:in
instance_exec' from /opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:25:in run’
from
/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:50:in
run_initializers' from /opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:49:in each’
from
/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/initializable.rb:49:in
run_initializers' from /opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:134:in initialize!’
from
/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:77:in
send' from /opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:77:in method_missing’
from /Users/kim/Projects/TestApp/config/environment.rb:5:in (root)' from /Users/kim/Projects/TestApp/config/environment.rb:26:in load’
from /Users/kim/Projects/TestApp/config/environment.rb:26:in
load_environment' from file:/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jetty-rails-0.8.1/lib/jruby-rack-0.9.5-SNAPSHOT.jar!/jruby/rack/rails.rb:151:in new’
from :2:in (root)' from file:/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jetty-rails-0.8.1/lib/jruby-rack-0.9.5-SNAPSHOT.jar!/rack/builder.rb:29:in instance_eval’
from
file:/opt/jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/jetty-rails-0.8.1/lib/jruby-rack-0.9.5-SNAPSHOT.jar!/rack/builder.rb:29:in
initialize' from <script>:2:in (root)’
at
org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:153)
at
org.jruby.rack.PoolingRackApplicationFactory$1.run(PoolingRackApplicationFactory.java:157)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.jruby.exceptions.RaiseException: (NameError)
uninitialized constant Rack::Runtime
2011-02-09 14:50:17.048::INFO: Started
[email protected]:3000

Rats. So close…
All I have to do is solve the rack problem.

A couple quick thoughts:

  • Rails 3.0.4 just came out and I haven’t had a chance to try it. It’s
    possible there’s just a bug here introduced by the new version that we
    haven’t caught and fixed yet.
  • The first part where you bundle-installed, by chance are you using
    RVM or otherwise used a different ruby than JRuby to do the bundle?
    Did you try ‘jruby -S bundle install’?

/Nick

On Tue, Feb 8, 2011 at 11:39 PM, Kimberley Scott

Sorry for the delay in response.
I’m on the Gold Coast Australia, so I’m ~10-12 hrs out from most of the
northern hemisphere :slight_smile:
Anyway, yeah I noticed that between me re-unpacking 1.6.0RC1 and
re-gem-installing I got rails 3.0.4 instead of 3.0.3.
In any case, I redid the unpacking using -v 3.0.3 and got the same
result to verify it wasn’t that.
I also did both ‘bundle install’ and ‘jruby -S bundle install’ with the
same result.
And ‘nope’ I’m not using rvm.
I’m suspecting the use of gem install ActiveRecord-JDBC instead of the
individual activerecord-jdbc-adapter/mysql-apapter is the cause.
In any case the ‘Part II’ of the process where I installed just the
plain adapters allowed me to get further down the path.

Just FYI, I apologise for the length of the post.
I come from 34 yrs of IT, starting in '77 with RSTS/E and RPG-II, so I
tend to document in detail what I did and why.
I find it makes it easier going for people to read and understand the
process.
Since this is also on StackOverflow, it will also make it easier for
lost souls to find a process-flow that works.

The premise behind the whole process is that I have been tasked to
create a tech stack that:

a) uses jruby on OS-X for the developers,
b) allows developers to use WEBrick, Tomcat or Jetty locally for
development and testing,
c) uses capistrano for deployment to ‘dev/stage’ Ubuntu servers using
Jetty for testers to test the sites,
d) uses capistrano for deployment to ‘live’ Ubuntu servers using
NGinx/Jetty and
e) document the entire thing in excruciating detail.

The only fly in the ointment I have not solved and configured is getting
jetty_rails to work for the developers.
That’s not fantastically important, but I like to be thorough and in any
case it’s in the requirement, and I’m here to do what I’m told, not what
I want :slight_smile:
Might have something to do with config.ru - I’ll check.
And to make matters more interesting, I see that 1.6.0RC2 is out - kool.
I’ll do the entire process again (I do like the scientific method) using
the new version and report back (er… with less detail :slight_smile:

Kimbo.

If Jetty is a requirement you should give a try to Kirk, it’s more up to
date than jetty-rails:

https://github.com/strobecorp/kirk

On Wed, Feb 9, 2011 at 9:14 PM, Kimberley Scott

Thanks heaps for that.
It looks like exactly what I was hoping for.
I’ll configure up a 1.6.0RC2 setup, try it out and report back.

Jeez I really must set up a blog or some-such new-fangled thang so I can
put all this in one place so others don’t have to go through this
trauma… :slight_smile:
It would be really nice to have an
“all-in-the-box-real-life-usage-recipes-with-ginzu-knives” place to go.
Sigh, 70-80 hr work weeks don’t leave much room for all the projects I
have planned.
Still, I’m 55 now and with adequate biotech I might reach 110, so I
still have a few years in me to get everything done…
Whoops - waffling again - my husband says I don’t have an ‘off’ switch
:wink:

Kimbo

“My legs are grey, my ears are nulled, my eyes are old and bent”