Declaring constant

I have a Sinatra app that runs okay with rvm jruby 1.6.4 by doing

bundle exec jruby -S rackup

However, when using warbler to create a .war file and deploy it to
glassfish, I get an uninitialized constant error.

This is where the constant comes from

config.ru requires ./main.rb
./main.rb requires ./boot.rb

The constant gets defined in boot.rb as this

#not real constant name
CONSTANT_PATH = File.expand_path(File.dirname(FILE))

When depoying it to glassfish, I get the following exception:

Caused by: org.jruby.exceptions.RaiseException: (NameError)
uninitialized constant CONSTANT_PATH

This is the warble config:

1 Warbler::Config.new do |config|
2 config.dirs = %w(config lib log vendor)
3 config.gems -= [“rails”]
4 config.gem_dependencies = true
5 config.includes = FileList[“config.ru”, “main.rb”, “boot.rb”,
“init.rb”]
6 end

As I mentioned, it works with jruby but not when used as a .war file in
glassfish.

Any ideas?

Thanks!

L.
http://www.saffie.ca

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