Closed rajgurung closed 11 years ago
try not using the gemjar feature and repackage your .war file without it (your gems won't be in a gems.jar file inside the .war and thus chdir should likely work)
Hi, i have the same issue in a different situation. I packed my simple program in a jar with warbler, ex:
puts \__FILE\__
puts File.dirname(__FILE__)
Dir.chdir(File.dirname(__FILE__))
When run from jar I got this:
file:/opt/piero/aptana-workspace/radm-core-new/dist/radm.jar!/radm-core/bin/radm
file:/opt/piero/aptana-workspace/radm-core-new/dist/radm.jar!/radm-core/bin
Errno::ENOTDIR: Not a directory - file:/opt/piero/aptana-workspace/radm-core-new/dist/radm.jar!/radm-core/bin
chdir at org/jruby/RubyDir.java:447
(root) at file:/opt/piero/aptana-workspace/radm-core-new/dist/radm.jar!/radm-core/bin/radm:6
load at org/jruby/RubyKernel.java:1046
(root) at file:/opt/piero/aptana-workspace/radm-core-new/dist/radm.jar!/META-INF/main.rb:1
require at org/jruby/RubyKernel.java:1027
(root) at file:/opt/piero/aptana-workspace/radm-core-new/dist/radm.jar!/META-INF/main.rb:1
(root) at jar:file:/tmp/jruby8885897003644405851extract/jruby-stdlib-1.7.3.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_
require.rb:1
error: org.jruby.embed.EvalFailedException: (Errno::ENOTDIR) file:/opt/piero/aptana-workspace/radm-core-new/dist/radm.jar!/radm-core/bin
Can anybody help me please? I'm blocked on this! Thank you!
Piero
Hey Pierro, I'm not sure what do you expect - it's a jar entry when packed inside an archive - not a FS directory.
You clearly can not chdir
to it ... you can try reporting on JRuby's tracker but I bet they won't "fix" this ...
Maybe try unpacking the .jar before running the ruby binary.
Also please do not that this seems as not a JRuby-Rack issue, thus shall be closed unless stated otherwise :)
I have uploaded my JrubyOnRails application on Elasticbean Stalk. I am getting a following error. Could anyone help please?