You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vadim@vadim:~/tarona$ bin/tarona
... Everything is fine ...
vadim@vadim:~/tarona$ cd bin
vadim@vadim:~/tarona/bin$ ./tarona
Errno::ENOENT: No such file or directory - /home/vadim/tarona/tarona
realpath at org/jruby/RubyFile.java:865
require_relative at uri:classloader:/jruby/kernel/kernel.rb:11
<main> at ./tarona:6
vadim@vadim:~/tarona/bin$ cd ../..
vadim@vadim:~$ tarona/bin/tarona
Errno::ENOENT: No such file or directory - /home/vadim/tarona/tarona/bin/tarona
realpath at org/jruby/RubyFile.java:865
require_relative at uri:classloader:/jruby/kernel/kernel.rb:11
<main> at tarona/bin/tarona:6
After Dir.chdir, as you can see, JRuby's relative_path is relative not to the file, but to the current working directory.
If bin/tarona is:
Files:
bin/tarona:
lib/tarona:
Run:
After
Dir.chdir
, as you can see, JRuby'srelative_path
is relative not to the file, but to the current working directory.If bin/tarona is:
Everything is fine. Also, MRI does it as expected in both cases.
Quote from RubyDoc about
require_relative
:The text was updated successfully, but these errors were encountered: