warble executable war; java -jar app.war => org.jruby.rack.RackInitializationException: no such file to load -- sinatra #115

Closed
drnic opened this Issue Oct 2, 2012 · 3 comments

Comments

Projects
None yet
3 participants

drnic commented Oct 2, 2012

My war file doesn't seem to contain sinatra when its being run:

$ ls 
Gemfile         Gemfile.lock        bin         config.ru       hello_world_jruby.war   vendor

$ bin/warble executable war
rm -f hello_world_jruby.war
Creating hello_world_jruby.war

$ java -jar hello_world_jruby.war
Oct 2, 2012 12:54:11 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Oct 2, 2012 12:54:12 PM winstone.Logger logInternal
WARNING: No webapp classes folder found - /private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/classes
Oct 2, 2012 12:54:12 PM winstone.Logger logInternal
INFO: INFO: jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_35) [darwin-x86_64-java]
Oct 2, 2012 12:54:12 PM winstone.Logger logInternal
INFO: INFO: using a shared (threadsafe!) runtime
Oct 2, 2012 12:54:14 PM winstone.Logger logInternal
INFO: An exception happened during JRuby-Rack startup
no such file to load -- sinatra
--- System
jruby 1.6.8 (ruby-1.8.7-p357) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_35) [darwin-x86_64-java]
Time: Tue Oct 02 12:54:14 -0700 2012
Server: Winstone Servlet Engine v0.9.10
jruby.home: file:/private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/lib/jruby-stdlib-1.6.8.jar!/META-INF/jruby.home

--- Context Init Parameters:
public.root = /
rack.env = production

--- Backtrace
LoadError: no such file to load -- sinatra
        require at org/jruby/RubyKernel.java:1062
         (root) at /private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/config.ru:1
  instance_eval at org/jruby/RubyKernel.java:2074
     initialize at file:/private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/lib/jruby-rack-1.1.10.jar!/vendor/rack-1.4.1/rack/builder.rb:51
         (root) at /private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/config.ru:1

--- Bundler
undefined method `bundle_path' for Bundler:Module

--- JRuby-Rack Config
compat_version = 
default_logger = org.jruby.rack.logging.StandardOutLogger@55f4c4a3
err = java.io.PrintStream@42101da9
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = false
initial_memory_buffer_size = 
initial_runtimes = 
jms_connection_factory = 
jms_jndi_properties = 
logger = org.jruby.rack.logging.ServletContextLogger@195092c0
logger_class_name = servlet_context
logger_name = jruby.rack
maximum_memory_buffer_size = 
maximum_runtimes = 
num_initializer_threads = 
out = java.io.PrintStream@12462631
rackup = 
rackup_path = 
rewindable = true
runtime_arguments = 
runtime_timeout_seconds = 
serial_initialization = false
servlet_context = winstone.WebAppConfiguration@2608b60a

--- $LOAD_PATH:
file:/private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/lib/jruby-rack-1.1.10.jar!/vendor/rack-1.4.1
file:/private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/lib/jruby-stdlib-1.6.8.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8
file:/private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/lib/jruby-stdlib-1.6.8.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared
file:/private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/lib/jruby-stdlib-1.6.8.jar!/META-INF/jruby.home/lib/ruby/1.8
.

Oct 2, 2012 12:54:14 PM winstone.Logger logInternal
SEVERE: ERROR: unable to create shared application instance
org.jruby.rack.RackInitializationException: no such file to load -- sinatra
    from org/jruby/RubyKernel.java:1062:in `require'
    from /private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/config.ru:1:in `(root)'
    from org/jruby/RubyKernel.java:2074:in `instance_eval'
    from file:/private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/lib/jruby-rack-1.1.10.jar!/vendor/rack-1.4.1/rack/builder.rb:51:in `initialize'
    from /private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/config.ru:1:in `(root)'

    at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:231)
    at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:58)
    at org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:33)
    at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:48)
    at winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:875)
    at winstone.HostConfiguration.initWebApp(HostConfiguration.java:129)
    at winstone.HostConfiguration.<init>(HostConfiguration.java:71)
    at winstone.HostGroup.initHost(HostGroup.java:87)
    at winstone.HostGroup.<init>(HostGroup.java:47)
    at winstone.Launcher.<init>(Launcher.java:177)
    at winstone.Launcher.main(Launcher.java:384)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at WarMain.launchWebserver(WarMain.java:136)
    at WarMain.start(WarMain.java:156)
    at WarMain.main(WarMain.java:181)
Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- sinatra
Oct 2, 2012 12:54:14 PM winstone.Logger logInternal
SEVERE: Error: application initialization failed
org.jruby.rack.RackInitializationException: no such file to load -- sinatra
    from org/jruby/RubyKernel.java:1062:in `require'
    from /private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/config.ru:1:in `(root)'
    from org/jruby/RubyKernel.java:2074:in `instance_eval'
    from file:/private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/lib/jruby-rack-1.1.10.jar!/vendor/rack-1.4.1/rack/builder.rb:51:in `initialize'
    from /private/var/folders/kg/3nj40p0s1836p_vzw497x9580000gq/T/warbler1535486286988956954webroot/hello_world_jruby.war/WEB-INF/config.ru:1:in `(root)'

    at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:231)
    at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:58)
    at org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:33)
    at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:48)
    at winstone.WebAppConfiguration.<init>(WebAppConfiguration.java:875)
    at winstone.HostConfiguration.initWebApp(HostConfiguration.java:129)
    at winstone.HostConfiguration.<init>(HostConfiguration.java:71)
    at winstone.HostGroup.initHost(HostGroup.java:87)
    at winstone.HostGroup.<init>(HostGroup.java:47)
    at winstone.Launcher.<init>(Launcher.java:177)
    at winstone.Launcher.main(Launcher.java:384)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at WarMain.launchWebserver(WarMain.java:136)
    at WarMain.start(WarMain.java:156)
    at WarMain.main(WarMain.java:181)
Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- sinatra
Oct 2, 2012 12:54:14 PM winstone.Logger logInternal
INFO: HTTP Listener started: port=8080
Oct 2, 2012 12:54:14 PM winstone.Logger logInternal
INFO: AJP13 Listener started: port=8009
Oct 2, 2012 12:54:14 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v0.9.10 running: controlPort=disabled

Env information:

$ java -version
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)

$ ruby -v
jruby 1.6.8 (ruby-1.9.2-p312) (2012-09-18 1772b40) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_35) [darwin-x86_64-java]

Suggestions?

drnic commented Oct 2, 2012

My gemfile:

$ cat Gemfile
source "https://rubygems.org"

gem "sinatra"
gem "warbler", group: "development"

$ cat Gemfile.lock 
GEM
  remote: https://rubygems.org/
  specs:
    jruby-jars (1.6.8)
    jruby-rack (1.1.10)
    rack (1.4.1)
    rack-protection (1.2.0)
      rack
    rake (0.9.2.2)
    rubyzip (0.9.9)
    sinatra (1.3.3)
      rack (~> 1.3, >= 1.3.6)
      rack-protection (~> 1.2)
      tilt (~> 1.3, >= 1.3.3)
    tilt (1.3.3)
    warbler (1.3.6)
      jruby-jars (>= 1.4.0)
      jruby-rack (>= 1.0.0)
      rake (>= 0.8.7)
      rubyzip (>= 0.9.4)

PLATFORMS
  java

DEPENDENCIES
  sinatra
  warbler
Owner

nicksieger commented Oct 3, 2012

Can you paste the listing of hello_world_jruby.war?

jar tf hello_world_jruby.war
Owner

kares commented May 4, 2016

this got outdated and should not longer be relevant ... if it is we need a new report

@kares kares closed this May 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment