Skip to content
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

9.0.3.0 file load error #3423

Closed
jzakiya opened this issue Oct 24, 2015 · 10 comments
Closed

9.0.3.0 file load error #3423

jzakiya opened this issue Oct 24, 2015 · 10 comments

Comments

@jzakiya
Copy link

jzakiya commented Oct 24, 2015

So I installed the new 9.0.3.0 via rvm (2015/10/22) and went to load a file, and get this
error:

jruby-9.0.3.0 :001 > load "primes-utils/lib/primes/utils4test.rb"
LoadError: no such file to load -- primes/utils/version
from org/jruby/RubyKernel.java:939:in require' from /home/jzakiya/.rvm/rubies/jruby-9.0.3.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54:in require'
from primes-utils/lib/primes/utils4test.rb:4:in <top>' from org/jruby/RubyKernel.java:957:inload'
from (irb):1:in <eval>' from org/jruby/RubyKernel.java:978:ineval'
from (irb):1:in evaluate' from org/jruby/RubyKernel.java:1291:inloop'
from org/jruby/RubyKernel.java:1098:in catch' from org/jruby/RubyKernel.java:1098:incatch'

I can load this file in any other prior version of JRuby this way with no problems, including 9.0.1.0.

On the other hand, to the extent I was able to 'require' some gems and test them, this version is A LOT FASTER!!

@dlbirch
Copy link

dlbirch commented Oct 25, 2015

I'm not using RVM, just using the new 9.0.3.0 straight up... same file errors when using 'require'. This is a blocker for using the new version.

@mkristian
Copy link
Member

cold you add -Xdebug.loadService to the commandline and paste the output here or a gist as it can be quite long !?

@dlbirch
Copy link

dlbirch commented Oct 26, 2015

LM-SJN-00874058-->jruby -S jirb -Xdebug.loadService
irb(main):001:0> require 'ascii_interpreter'
LoadError: no such file to load -- ascii_interpreter
    from org/jruby/RubyKernel.java:939:in `require'
    from /Users/dbirch/Documents/jruby/versions/jruby-9.0.3.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from (irb):1:in `<eval>'
    from org/jruby/RubyKernel.java:978:in `eval'
    from org/jruby/RubyKernel.java:1291:in `loop'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from /Users/dbirch/Documents/jruby/versions/jruby-9.0.3.0/bin/jirb:13:in `<top>'
irb(main):002:0> quit
>LM-SJN-00874058-->jirb -Xdebug.loadService
IRB::UnrecognizedSwitch: Unrecognized switch: -Xdebug.loadService
>LM-SJN-00874058-->jruby -S -Xdebug.loadService
NameError: uninitialized constant Xdebug
  const_missing at org/jruby/RubyModule.java:3181
          <top> at -Xdebug.loadService:1
>LM-SJN-00874058-->jruby -S jirb -Xdebug.loadService
irb(main):001:0> puts 'hello chris'
hello chris
=> nil
irb(main):002:0> load 'ascii_interpreter'
LoadError: no such file to load -- ascii_interpreter
    from org/jruby/RubyKernel.java:957:in `load'
    from (irb):2:in `<eval>'
    from org/jruby/RubyKernel.java:978:in `eval'
    from org/jruby/RubyKernel.java:1291:in `loop'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from /Users/dbirch/Documents/jruby/versions/jruby-9.0.3.0/bin/jirb:13:in `<top>'
irb(main):003:0> require 'ascii_interpreter'
LoadError: no such file to load -- ascii_interpreter
    from org/jruby/RubyKernel.java:939:in `require'
    from /Users/dbirch/Documents/jruby/versions/jruby-9.0.3.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from (irb):3:in `<eval>'
    from org/jruby/RubyKernel.java:978:in `eval'
    from org/jruby/RubyKernel.java:1291:in `loop'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from /Users/dbirch/Documents/jruby/versions/jruby-9.0.3.0/bin/jirb:13:in `<top>'
irb(main):004:0> require 'ascii_interpreter.rb'
LoadError: no such file to load -- ascii_interpreter
    from org/jruby/RubyKernel.java:939:in `require'
    from /Users/dbirch/Documents/jruby/versions/jruby-9.0.3.0/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from (irb):4:in `<eval>'
    from org/jruby/RubyKernel.java:978:in `eval'
    from org/jruby/RubyKernel.java:1291:in `loop'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from /Users/dbirch/Documents/jruby/versions/jruby-9.0.3.0/bin/jirb:13:in `<top>'
irb(main):005:0> quit
>LM-SJN-00874058-->ls ascii_interpreter.rb
ascii_interpreter.rb
>LM-SJN-00874058-->which java
/usr/bin/java
>LM-SJN-00874058-->java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
>LM-SJN-00874058-->which jruby
/Users/dbirch/Documents/jruby/versions/jruby-9.0.3.0/bin/jruby
>LM-SJN-00874058-->jruby --version
jruby 9.0.3.0 (2.2.2) 2015-10-21 633c9aa Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]
LM-SJN-00874058-->

@jzakiya
Copy link
Author

jzakiya commented Oct 26, 2015

Well now it works for me!
Using rvm, I initially did an upgrade (not independent install) from 9.0.1.0, and merged all gems from it, and deleted it. Everything went as normal and I was left with 9.0.3.0 and 9.0.1.0's old gems.

When I initially tried 9.0.3.0 I just used it after the upgrade finished and got the file load error as shown. OK, after doing a reboot of my system a couple of days later (for unrelated reasons) and tried it then, it works fine! Just to be sure, I did it with irb and pry too, and no problems. I can 'load' files as normal. This seems to suggest some initialization issue after installing, since after rebooting things now work. I hope this helps track down the nature of the problem.

BTW, my system is a 32-bit Linux distro using 4.1.11 kernal, on a Lenovo laptop with I5 cpu.

@jzakiya jzakiya closed this as completed Oct 26, 2015
@jzakiya
Copy link
Author

jzakiya commented Oct 26, 2015

Thit!, I didn't mean to close thread. Hit the wrong button. Sorry!

@jzakiya jzakiya reopened this Oct 26, 2015
@dlbirch
Copy link

dlbirch commented Oct 27, 2015

The error in loading or requiring files can be traced (at least in my case) to the content of my base path of the currently executing 'jirb' ...
irb(main):001:0> require_relative './ascii_interpreter'
LoadError: cannot infer basepath
from uri:classloader:/jruby/kernel/kernel.rb:9:in require_relative' from (irb):1:in'
from org/jruby/RubyKernel.java:978:in eval' from org/jruby/RubyKernel.java:1291:inloop'
from org/jruby/RubyKernel.java:1098:in catch' from org/jruby/RubyKernel.java:1098:incatch'
from /Users/dbirch/Documents/jruby/versions/jruby-9.0.3.0/bin/jirb:13:in `'
irb(main):003:0> require '/Users/dbirch/Documents/RubymineProjects/rubyPOS/ascii_interpreter.rb'
=> true

@mkristian
Copy link
Member

oh this last example fails also on jrub-1_7 branch

@mkristian
Copy link
Member

when looking at the previous examples: require 'something.rb" or load 'something.rb' ONLY works with "." is on the $LOAD_PATH (or whatever directory something.rb resides needs to be on the LOAD_PATH). whereas require './something.rb' should work. this is the only reproducible case I have here on this issue.

@enebo enebo modified the milestones: JRuby 1.7.23, JRuby 1.7.24 Nov 24, 2015
@enebo enebo modified the milestones: JRuby 1.7.24, JRuby 1.7.25 Jan 20, 2016
@enebo enebo modified the milestones: JRuby 1.7.26, JRuby 1.7.25 Apr 11, 2016
@enebo enebo modified the milestones: JRuby 1.7.26, JRuby 1.7.27 Aug 26, 2016
@headius
Copy link
Member

headius commented Mar 15, 2017

Very old. If someone pipes up that this is still affecting them, we might look at it...but for now I'm closing.

@headius headius closed this as completed Mar 15, 2017
@mhenrixon
Copy link

mhenrixon commented Oct 2, 2019

https://travis-ci.org/mhenrixon/sidekiq-unique-jobs/jobs/592614269

Failures:
  1) SidekiqUniqueJobs::Cli.console when Pry is available behaves like start console 
     Failure/Error: console_class.start
     IRB::UnrecognizedSwitch:
       Unrecognized switch: --require
     Shared Example Group: "start console" called from ./spec/unit/sidekiq_unique_jobs/cli_spec.rb:128
     # ./lib/sidekiq_unique_jobs/cli.rb:44:in `console'
     # ./gemfiles/vendor/bundle/jruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
     # ./gemfiles/vendor/bundle/jruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
     # ./gemfiles/vendor/bundle/jruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
     # ./gemfiles/vendor/bundle/jruby/2.5.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
     # ./spec/unit/sidekiq_unique_jobs/cli_spec.rb:27:in `exec'
     # ./spec/unit/sidekiq_unique_jobs/cli_spec.rb:107:in `block in console'
     # ./spec/spec_helper.rb:57:in `capture'
     # ./spec/unit/sidekiq_unique_jobs/cli_spec.rb:107:in `block in console'
     # ./spec/unit/sidekiq_unique_jobs/cli_spec.rb:115:in `block in <main>'

https://github.com/mhenrixon/sidekiq-unique-jobs/blob/34d6cce9af434bc2ea756733385ae07de736a31e/spec/unit/sidekiq_unique_jobs/cli_spec.rb#L132

No idea why jRuby is choking on this...

Is jRuby passing on the arguments that I initially passed to RSpec? bundle exec rspec --require spec_helper --tag ~perf?

Having to do the following (seems yuck to me) : mhenrixon/sidekiq-unique-jobs@1982926

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

No branches or pull requests

6 participants