Strange issue with jruby rack & rails production settings

I need to do more sleuthing on this, but for some reason when I set our
app to run in production mode in rails I’m getting this error (see
below). Running in development mode is fine.

The file its complaining about is there. The enviroment.rb lines in
question are:

config.after_initialize do
ValidatesDateTime.us_date_format = true
require “lib/active_record/errors.rb”
require “lib/soundex/Soundex.rb”
require “lib/mmwr/mmwr.rb”
require “lib/blankable.rb”
require “lib/extend_better_nested_set.rb”
end

Any ideas on debugging?

Thanks,

Mike

17-Jul-2008 7:27:56 AM org.apache.catalina.core.ApplicationContext log
SEVERE: Exception caught
org.jruby.rack.RackInitializationException: no such file to load –
lib/active_record/errors
from
file:/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/lib/jruby-complete-1.1.1.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require' from /home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from
/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in
new_constants_in' from /home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from
/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/config/environment.rb:71:in
/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/config/environment.rb' from /home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336:incall’
from
/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336:in
after_initialize' from /home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:335:ineach’
… 9 levels…
from
file:/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22:in
initialize' from file:/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:1:innew’
from
file:/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:1

     at

org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:151)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:53)
at
org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:92)
at
org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:31)
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jruby.exceptions.RaiseException


Mike H.
Program Manager, Collaborative Software Initiative
[email protected]
http://www.csinitiative.com


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Is it in the new JRuby 1.1.3 that require is being re-written that if
you add .rb that you’ll run into a problem or was that added in 1.1.2?
I think I read that you need to exclude .rb from the end.

-Joel

----- Original Message -----
From: “Mike H.” [email protected]
To: [email protected]
Sent: Thursday, July 17, 2008 9:31:58 AM GMT -06:00 US/Canada Central
Subject: [jruby-user] strange issue with jruby rack & rails production
settings

I need to do more sleuthing on this, but for some reason when I set our
app to run in production mode in rails I’m getting this error (see
below). Running in development mode is fine.

The file its complaining about is there. The enviroment.rb lines in
question are:

config.after_initialize do
ValidatesDateTime.us_date_format = true
require “lib/active_record/errors.rb”
require “lib/soundex/Soundex.rb”
require “lib/mmwr/mmwr.rb”
require “lib/blankable.rb”
require “lib/extend_better_nested_set.rb”
end

Any ideas on debugging?

Thanks,

Mike

17-Jul-2008 7:27:56 AM org.apache.catalina.core.ApplicationContext log
SEVERE: Exception caught
org.jruby.rack.RackInitializationException: no such file to load –
lib/active_record/errors
from
file:/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/lib/jruby-complete-1.1.1.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
require' from /home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from
/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in
new_constants_in' from /home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:496:inrequire’
from
/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/config/environment.rb:71:in
/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/config/environment.rb' from /home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336:incall’
from
/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:336:in
after_initialize' from /home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/gems/gems/rails-2.0.2/lib/initializer.rb:335:ineach’
… 9 levels…
from
file:/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:22:in
initialize' from file:/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:1:innew’
from
file:/home/mike/opt/apache-tomcat-6.0.14/webapps/nedss/WEB-INF/lib/jruby-rack-0.9.jar!/rack/builder.rb:1

     at

org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:151)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:53)
at
org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:92)
at
org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:31)
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.jruby.exceptions.RaiseException


Mike H.
Program Manager, Collaborative Software Initiative
[email protected]
http://www.csinitiative.com


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Thu, Jul 17, 2008 at 9:31 AM, Mike H. [email protected]
wrote:

require “lib/soundex/Soundex.rb”
require “lib/mmwr/mmwr.rb”
require “lib/blankable.rb”
require “lib/extend_better_nested_set.rb”
end

I assume this expects that either RAILS_ROOT is on the $LOAD_PATH or
that current working directory is RAILS_ROOT? With JRuby-Rack 0.9,
neither is the case. You should probably change the code to remove the
“lib/” prefix on all the requires anyway.

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks Nick, that fixed it.

Any idea why it would work fine with Rails development settings, but not
production?

Mike

Nick S. wrote:

require “lib/active_record/errors.rb”

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

PWD (’.’) is usually included in $LOAD_PATH, and development servers
are usually run from RAILS_ROOT, so it can find the files.

/Nick

On Thu, Jul 17, 2008 at 12:16 PM, Mike H. [email protected]
wrote:

wrote:

config.after_initialize do
neither is the case. You should probably change the code to remove the


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

makes sense thanks.

From the README:
http://svn.codehaus.org/jruby-contrib/trunk/rack/README.txt

re: logging.

Should JRuby Rack pick up logging settings (info, etc.?). I’m seeing
full debug logging and can’t seem to shut it off.

Mike

Mike H.
Program Manager, Collaborative Software Initiative
[email protected]
Portland, Or 97258
http://www.csinitiative.com

Nick S. wrote:

The file its complaining about is there. The enviroment.rb lines in
end
http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs