New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't package the app: NameError: uninitialized constant Bundler #1148
Comments
Can confirm this is happening on OSX 10.10.3, java 1.8.0_45, jruby 1.7.19, shoes 4.0.0.pre4
Additional stack trace:
|
Hi there! Thank you for your bug report and stack traces! Packaging is still a baby though, that needs to be treated gently :) @Le6ow5k1 if you're on Linux you can't/shouldn't build app as .app is the Mac OSX format. We don't have a dedicated linux format yet - try packaging @cfurrow what did the .jar say when you ran it? Thanks everyone! |
@PragTob I pulled down the latest master branch, and ran
|
Thanks!
I don't have time today (bed time!) or tomorrow... I'll see if I can give this another run through on my system Wednesday or so to see if I'm able to reproduce this issue. It could be helpful if you have a minimal app file that you try to package. Otherwise I'll just try to package our sample app :) Thanks! |
Yeah, I'll play around some more with the sample apps, and maybe create my own simple app for testing, with more reproducible steps. I appreciate the help. |
I am also having the same Bundler Error on Windows 7 64bit when trying to package a jar file. As I am using the newest version of JRuby (9.0.0.0), I am going to try again using an older version of JRuby. I am using Java1.8.0_51 and shoes4.0.0pre4. |
Sorry to say but it works for me on master...
I'm on Linux Mint 17.2 (based on Ubuntu 14.04) and it just works. @cfurrow still a problem for you? @chand1012 could you supply a log? Sorry for the long hold up :) Busy organizing JRubyConf.EU :) |
Hey @PragTob, yeah, it still seems like it's an issue for me on my own app, but not for the package_me.rb example.
It did not work without a Gemfile, so I copied the Gemfile from the shoes4 root dir, updated the paths to point to my local shoes4 repo that was up to date w/ master, and got my example app working. I'll look into getting my other super-simple app working, but without the Gemfile there were bundler issues. Thanks for checking back in, and good luck organizing JRubyConf.EU. Exciting!
|
Hey @cfurrow ! Thanks for checking back! :) JRubyConf.EU already happened - it was great, thanks :) Right now all I can say sadly is that packaging is still a baby... I've never done bundlign with a packaged app that is on the road map for some later point in time - but packaging quickly becomes the last big thing that we should tackle. Sorry for the inconveniences everyone! Tobi |
Dear people, |
Hello everyone! $ shoes-swt enveomics.rb # I get the same result with just `shoes enveomics.rb`
Wearing shoes.
2015-12-02 14:47:36.691 java[48990:6260381] *** WARNING: Method userSpaceScaleFactor in class NSWindow is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. But when I try to package it: $ shoes-swt -p swt:jar enveomics.rb # I get the same result with just `shoes -p swt:jar enveomics.rb`
Packaging swt:jar...
NameError: uninitialized constant Bundler
const_missing at org/jruby/RubyModule.java:3181
to_spec at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/warbler-1.4.9/lib/warbler/bundler_helper.rb:12
find_single_gem_files at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/warbler-1.4.9/lib/warbler/gems.rb:58
block in specs at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/warbler-1.4.9/lib/warbler/gems.rb:46
each at org/jruby/RubyHash.java:1343
map at org/jruby/RubyEnumerable.java:800
specs at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/warbler-1.4.9/lib/warbler/gems.rb:46
find_gems_files at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/warbler-1.4.9/lib/warbler/jar.rb:197
apply at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/warbler-1.4.9/lib/warbler/jar.rb:144
block in package at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/furoshiki-0.3.1/lib/furoshiki/jar.rb:20
chdir at org/jruby/RubyDir.java:326
package at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/furoshiki-0.3.1/lib/furoshiki/jar.rb:18
block in run at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/shoes-swt-4.0.0.pre4/lib/shoes/swt/packager.rb:29
each at org/jruby/RubyArray.java:1560
run at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/shoes-swt-4.0.0.pre4/lib/shoes/swt/packager.rb:25
run at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/shoes-core-4.0.0.pre4/lib/shoes/packager.rb:24
run at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/shoes-core-4.0.0.pre4/lib/shoes/ui/cli.rb:70
<top> at /usr/local/Cellar/jruby/9.0.3.0/libexec/lib/ruby/gems/shared/gems/shoes-swt-4.0.0.pre4/bin/shoes-swt:11
load at org/jruby/RubyKernel.java:957
<top> at /usr/local/Cellar/jruby/9.0.3.0/libexec/bin/shoes-swt:23 Since the error is a the missing Bundler, I thought maybe preloading the library would help, and it actually DID build the jar: $ ruby -r bundler $(which shoes-swt) -p swt:jar enveomics.rb
Packaging swt:jar...
rm -f pkg/enveomics.jar
Creating pkg/enveomics.jar But alas, when I try to open it I get @cfurrow's error message: $ java -jar pkg/enveomics.jar
Ignoring shoes-core-4.0.0.pre4 because its extensions are not built. Try: gem pristine shoes-core --version 4.0.0.pre4
LoadError: no such file to load -- shoes
require at org/jruby/RubyKernel.java:1040
require at /var/folders/jt/_hhggq8d5sv7wssfh7bgmqlm0000gp/T/jruby3443158316861674340extract/jruby-stdlib-1.7.23.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54
(root) at file:/Users/lmr3/enveomics/GUI/pkg/enveomics.jar!/META-INF/init.rb:8
require at org/jruby/RubyKernel.java:1040
(root) at /var/folders/jt/_hhggq8d5sv7wssfh7bgmqlm0000gp/T/jruby3443158316861674340extract/jruby-stdlib-1.7.23.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
require at /var/folders/jt/_hhggq8d5sv7wssfh7bgmqlm0000gp/T/jruby3443158316861674340extract/jruby-stdlib-1.7.23.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54
ERROR: org.jruby.embed.EvalFailedException: (LoadError) no such file to load -- shoes I don't think I'm doing anything particularly wacky in my app, but here's the code just in case. -- Miguel. |
Thank you for the detailed bug report @lmrodriguezr - especially for providing it with code :) What strikes me as a bit odd immedeatly is that it is rambling on about stdlib-1.7.23 but you have 9.0.3.0 packaging still is but a baby... I guess next step for us here would be to clone the repo and try to run and package up the app ourselves, might take us a while though (personally super busy the next 3 days) Feel super free to ping us about it if we don't seem to have taken a look at it in a timely manner and thanks very much for your report! :) Tobi |
;tldr: If you use I tried again from the shoes dir, as in @PragTob's test, and I have no problems packaging: $ cd ~/Software/shoes4
$ bin/shoes-swt -p swt:jar ~/enveomics/GUI/enveomics.rb
Packaging swt:jar...
rm -f pkg/enveomics.jar
Creating pkg/enveomics.jar But I get a very different error (perhaps this should be a different thread?). First, it fails to open in the foreground: $ java -jar ~/enveomics/GUI/pkg/enveomics.jar
***WARNING: Display must be created on main thread due to Cocoa restrictions.
Ooops, we couldn't start properly. We'll try again.
To avoid this restarting behavior, try one of the following:
* Use the shoes executable to start your app
* Add JRUBY_OPTS='-J-XstartOnFirstThread' to your environment before starting.
/bin/sh: -c: line 0: syntax error near unexpected token `newline'
/bin/sh: -c: line 0: `JRUBY_OPTS=-J-XstartOnFirstThread <script>' But when I pass the option explicitly, it doesn't find a file within the jar (full trace here): $ java -jar -XstartOnFirstThread ~/enveomics/GUI/pkg/enveomics.jar
Wearing shoes.
Exception: i/o error (java.io.FileNotFoundException: /Users/lmr3/enveomics/GUI/pkg/enveomics.jar!/shoes-app/img/noun_208357_cc.png (No such file or directory))
java.lang.reflect.Constructor.newInstance(java/lang/reflect/Constructor.java:422)
RUBY.create_image(/Users/lmr3/enveomics/GUI/pkg/enveomics.jar!/gems/shoes-swt-4.0.0.pre4/lib/shoes/swt/image.rb:53)
[...] The very weird thing is... the file it complains about is actually there (I opened the jar with [...]
732 shoes-app/enveomics.rb
733 shoes-app/img/
734 shoes-app/img/noun_208357_cc.png
735 shoes-app/img/noun_229118_cc.png
736 shoes-app/lib/
737 shoes-app/lib/enve-collection.rb
[...] The error traces back to the line 171 in my code, which is inside a [...]
23 $img_path = File.expand_path("../img", File.dirname(__FILE__))
[...]
171 image File.expand_path("noun_208357_cc.png",$img_path),
172 width: 50, height: 50, margin: 2
[...] And when I remove the Thanks! |
hey @lmrodriguezr that should indeed go to another thread :) There might actually already be one there for that, and the problem is referencing assets from within the package. I think it gets confused by being inside a jar (i.e. value of Also thanks for the observation that packaging works only with |
@PragTob yes, I found a couple of threads on it, sorry about that.
No, I'm sure I'm calling the |
There's a lot of separate things going on here, but I've posted #1189 which for me takes care of the initial problem of not finding the Bundler constants when packaging. I'm keen to get |
FYI this was reverted in #1208 due to reasons described there, we'll look for another solution to fix this up. Sorry for the inconvenience everyone :( |
For the time #1189 was alive, I noticed it wasn't solving the Bundler constants problem either (but I didn't test carefully). I did notice it had significantly increased the size of the |
The primary Bundler issues here is fixed with #1325 which should be out in the next pre release ( |
When I try to package an app:
I get the following error:
full stack trace
I'm running it on Ubuntu 14.04 and using rvm with jruby-1.7.19.
It seems like the problem is not on shoes side, but...
The text was updated successfully, but these errors were encountered: