Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Created jar fails to load dependencies through bundler #146

Open
betelgeuse opened this Issue Apr 3, 2013 · 1 comment

Comments

Projects
None yet
1 participant

betelgeuse commented Apr 3, 2013 edited by kares

betelgeuse@mac ~/app $ java -jar app.jar 
NameError: uninitialized constant OAuth2
     const_missing at org/jruby/RubyModule.java:2677
            (root) at /Users/betelgeuse/app/./client.rb:6
           require at org/jruby/RubyKernel.java:1027
            (root) at jar:file:/var/folders/vq/sv00hgxs7nlf_p_76vm2ps1c0000gn/T/jruby8485930230575471613extract/jruby-stdlib-1.7.3.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1
           require at jar:file:/var/folders/vq/sv00hgxs7nlf_p_76vm2ps1c0000gn/T/jruby8485930230575471613extract/jruby-stdlib-1.7.3.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36
           require at org/jruby/RubyKernel.java:1027
            (root) at file:/Users/betelgeuse/app/app.jar!/app/bin/../poll.rb:1
            (root) at jar:file:/var/folders/vq/sv00hgxs7nlf_p_76vm2ps1c0000gn/T/jruby8485930230575471613extract/jruby-stdlib-1.7.3.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:1
           require at jar:file:/var/folders/vq/sv00hgxs7nlf_p_76vm2ps1c0000gn/T/jruby8485930230575471613extract/jruby-stdlib-1.7.3.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36
              load at org/jruby/RubyKernel.java:1046
  require_relative at file:/var/folders/vq/sv00hgxs7nlf_p_76vm2ps1c0000gn/T/jruby8485930230575471613extract/jruby-core-1.7.3.jar!/jruby/kernel19/kernel.rb:19
           require at org/jruby/RubyKernel.java:1027
            (root) at file:/Users/betelgeuse/app/app.jar!/app/bin/executable:1
            (root) at file:/Users/betelgeuse/app/app.jar!/META-INF/main.rb:1
error: org.jruby.embed.EvalFailedException: (NameError) uninitialized constant OAuth2

betelgeuse@mac ~/app $ ruby bin/executable
betelgeuse@mac ~/app $

The loading code in client.rb basically does:

require 'rubygems'
require 'bundler/setup'
Bundler.require
require './credentials'

OAuth2

Sames problem exists with 1.3.6 and ce3ce4d

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1446625-created-jar-fails-to-load-dependencies-through-bundler?utm_campaign=plugin&utm_content=tracker%2F136961&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F136961&utm_medium=issues&utm_source=github).

Relevant here seems to be trying to run the project from the project directory. After copying the jar to server I get #147.

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