2

Ok。JRuby/Rails3 を jetty と tomcat で実行しようとして、かなりイライラしています。OS-X で実行されている jruby/rails3 と jetty/tomcat アプリのローカル インストールを取得しようとしています。(そして最終的にUbuntuステージとライブサーバーに)起動時に常に発生するエラーは

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

なぜこれが起こるのかを見つけようとして、気が散るように自分自身をグーグルで検索しようとしました。ある情報源は「bundler」の問題について言及しましたが、バージョン情報は提供しませんでした。他のほとんどの人は、Gemfile を変更するためのさまざまなオプションを提供しましたが、私は過去 5 時間徹底的に試しましたが、うまくいきませんでした。

憤慨して、プレーンインストールでゼロから始めることにしました。

/opt/jruby のシンボリック リンクを使用して /opt/jruby-1.6.0.RC1/ に jruby をインストールしました。インストールされた宝石:

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)

ご覧のとおり、これを機能させるためにかなりの数の gem をインストールしました。はぁ… ActiveRecord-JDBC かも?

とにかく、dev フォルダーに移動します。

cd ~/dev_folder
jruby -S rails new test_app --database mysql --template http://jruby.org
...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...

たとえば、トリニダードを開始します。

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

または 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

新しいフォルダーにjrubyを再インストールし、絶対最小限のgemをインストールして、同じことをもう一度試します。

それまでの間、なぜこれが起こっているのかについての手がかりを誰かが持っている場合は、投稿してください。これについては私だけではないと確信しています...

キンボ。

ああ。うーん。Ok。「ベアメタルから」の完全なインストールのトランスクリプトを次に示します。

以前の jruby インストールをアーカイブし、tarball から再展開しました。

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

他の gem をインストールします。

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 http://jruby.org
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.

データベースを作成します。

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)

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)

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

トリニダードを試す:

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/RubymineProjects/TestApp/config/boot.rb:6:in `(root)'
from org/jruby/RubyKernel.java:1041:in `require'
from /Users/kim/RubymineProjects/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

おっと。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: 

http://localhost:3000/rails/info/propertiesを参照すると、すべて問題ありません。

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)

パブリック index.html を編集すると、変更が利用可能になります。

今すぐ 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'

修正は /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

これを変える:

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

これに:

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

これは Rails バージョンの if/else を使用する必要がありますが、これは簡単な修正です。

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/RubymineProjects/TestApp/config/environment.rb:5:in `(root)'
from /Users/kim/RubymineProjects/TestApp/config/environment.rb:26:in `load'
from /Users/kim/RubymineProjects/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 <script>: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 SelectChannelConnector@0.0.0.0:3000

ネズミ。とても近い...

4

1 に答える 1

-1

あなたの質問に対する具体的な回答ではありませんが、JRuby/JBoss で Rails アプリを実行するためにTorqueBoxをチェックしてみてください。起動して実行するのは非常に簡単です。

于 2011-06-03T15:52:17.060 に答える