Rack, Camping and missing require

Hey list,

I’m trying to get jruby-rack and camping running together. My test
application lives in lib/demo.rb (named Demo). Setting the rackup script
to
“run Rack::Adapter::Camping.new(Demo)” raises an exception that Demo
cannot
be found. I suppose the file isn’t "require"d anywhere.

How to I configure warbler/jruby-rack to require my app file?

TIA
robert

On Tue, Jul 22, 2008 at 8:45 PM, Nick S. [email protected]
wrote:

How to I configure warbler/jruby-rack to require my app file?

inside your rackup parameter. Can you download
c a l d e r s p h e r e . n e t and
try it?

Actually it turns out that the require works in 0.9. I just wasn’t aware
of
being able to use require in the rackup script. This should definatly be
on
the wiki page.

I haven’t tested using the camping gem with the trunk version (no time
yet),
copying the gems to lib worked however. Also there seems to be a glitch
handling rack’s enviroment. See JRUBY-2859.

Right now everything seems to work using the patched camping adapter.
I’ll
investigate further after showing off camping on tomcat during my
presentation tomorrow :smiley:

On Tue, Jul 22, 2008 at 2:41 AM, robber [email protected] wrote:

Hey list,

I’m trying to get jruby-rack and camping running together. My test
application lives in lib/demo.rb (named Demo). Setting the rackup script to
“run Rack::Adapter::Camping.new(Demo)” raises an exception that Demo cannot
be found. I suppose the file isn’t "require"d anywhere.

How to I configure warbler/jruby-rack to require my app file?

Hi Robert, I think you’re headed in the right direction, the problem
right now is that “lib” isn’t put on the load path. JRuby-Rack 0.9
unfortunately won’t help you, but I fixed an issue in the trunk
version that should be out soon that will allow you to assume that
WEB-INF is the current directory while you’re loading, so you could do
something like:

require ‘./lib/demo’
run Rack::Adapter::Camping.new(Demo)

inside your rackup parameter. Can you download
c a l d e r s p h e r e . n e t and
try it?

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email