quirkey/resque-status

Compatibility with jRuby

Closed this issue · 4 comments

I'm not sure why when I require resque-status in my sinatra app I get this error:

when running COUNT=2 VERBOSE=true QUEUE=* rake resque:workers --trace for example;

JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
MongoDB logging. Please note that logging negatively impacts performance and should be disabled for high-performance production apps.
MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1)
rake aborted!
can't convert Class into String
org/jruby/RubyFile.java:872:in `basename'
org/jruby/RubyFile.java:1069:in `extname'
(eval):3:in `extname_with_potential_path_argument'
/Users/amr/.rvm/gems/jruby-1.6.3@global/gems/rake-0.9.2/lib/rake/application.rb:561:in `load_imports'
/Users/amr/.rvm/gems/jruby-1.6.3@global/gems/rake-0.9.2/lib/rake/application.rb:502:in `raw_load_rakefile'
/Users/amr/.rvm/gems/jruby-1.6.3@global/gems/rake-0.9.2/lib/rake/application.rb:78:in `load_rakefile'
/Users/amr/.rvm/gems/jruby-1.6.3@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/amr/.rvm/gems/jruby-1.6.3@global/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/Users/amr/.rvm/gems/jruby-1.6.3@global/gems/rake-0.9.2/lib/rake/application.rb:61:in `run'
/Users/amr/.rvm/gems/jruby-1.6.3@global/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/amr/.rvm/gems/jruby-1.6.3@global/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/amr/.rvm/gems/jruby-1.6.3@global/gems/rake-0.9.2/bin/rake:32:in `(root)'
org/jruby/RubyKernel.java:1063:in `load'
/Users/amr/.rvm/gems/jruby-1.6.3@global/bin/rake:19:in `(root)'

I'm not sure how familiar the resque-status dev is with JRuby so I got this in front of some JRuby eyes. They recommended trying a more recent version. It looks like you're using rvm which has the latest version, JRuby 1.6.5 available for installation. I primarily recommend this because 1.6.5 has many bug fixes in it.

My initial guess at this would be a contention between Rake and JRuby import statements. I would not be surprised if the code runs fine outside of rake and blows up like this while trying to run the tests. I don't see any import statements in the resque-status codebase so I imagine that it is in one of it's dependencies.

Ok, so i did a bit of digging and I think I figured this out. resque-status has a dependency on uuid. uuid has a dep on macaddr, which has a dep on systemu. systemu contains a jruby specific block that uses the jruby import statement. The jruby import clashes with the rake import. I think the jruby community advocates moving to the java_import statement instead to deal with issues like this but the import is still left in for backward compatibility.

Anyway. I made the mod to a fork of systemu in my github account and started using that for a project that I have that uses resque-status and I can now run tests under jruby without the typical cant convert Class to String explosion going on. I have a pull req into the owner of systemu so hopefully it will make it in there sometime in the future.

Since this seems to be a downstream problem with JRuby/Systemu/uuid closing this ticket.