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

require_relative fails sometimes with JRuby 1.7.22 on Win7 #3466

Closed
robertpanzer opened this issue Nov 16, 2015 · 5 comments
Closed

require_relative fails sometimes with JRuby 1.7.22 on Win7 #3466

robertpanzer opened this issue Nov 16, 2015 · 5 comments
Assignees
Milestone

Comments

@robertpanzer
Copy link

We've got an issue with AsciidoctorJ with asciidoctor-diagram running on Win 7 when JRuby 1.7.22 is used.
When asciidoctor-diagram is required the JRuby fails with this:

org.jruby.exceptions.RaiseException: (Errno::ENOENT) C:\Users\robert.panzer\.gradle\caches\modules-2\files-2.1\org.asciidoctor\asciidoctorj-diagram\1.3.1\2bab2cb40a6770e8943c5d944d5961d1b4a6f7e8\asciidoctorj-diagram-.3.1.jar!\gems\asciidoctor-diagram-1.3.1\lib\asciidoctor-diagram\blockdiag.rb
        at org.jruby.RubyFile.realpath(org/jruby/RubyFile.java:840)
        at RUBY.require_relative(file:/C:/Users/robert.panzer/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.22/42dc9be2f706774c24ef61ec2981d05e2c79a9e2/jruby-complete-1.7.22.jar!/jruby/kernel19/kernel.rb:11)
        at RUBY.(root)(C:/Users/robert.panzer/.gradle/caches/modules-2/files-2.1/org.asciidoctor/asciidoctorj-diagram/1.3.1/2bab2cb40a6770e8943c5d944d5961d1b4a6f7e8/asciidoctorj-diagram-1.3.1.jar!/gems/asciidoctor-diagram-1.3.1/lib/asciidoctor-diagram/blockdiag.rb:2)
        at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1040)
        at RUBY.(root)(/C:/Users/robert.panzer/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.22/42dc9be2f706774c24ef61ec2981d05e2c79a9e2/jruby-complete-1.7.22.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
        at RUBY.require(/C:/Users/robert.panzer/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.22/42dc9be2f706774c24ef61ec2981d05e2c79a9e2/jruby-complete-1.7.22.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
        at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1040)
        at RUBY.(root)(C:/Users/robert.panzer/.gradle/caches/modules-2/files-2.1/org.asciidoctor/asciidoctorj-diagram/1.3.1/2bab2cb40a6770e8943c5d944d5961d1b4a6f7e8/asciidoctorj-diagram-1.3.1.jar!/gems/asciidoctor-diagram-1.3.1/lib/asciidoctor-diagram.rb:1)
        at RUBY.(root)(/C:/Users/robert.panzer/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/1.7.22/42dc9be2f706774c24ef61ec2981d05e2c79a9e2/jruby-complete-1.7.22.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)

This error does not appear when using the JRuby 1.7.21 or below.

We opened an issue in AsciidoctorJ for that which we resolved atm by downgrading to 1.7.21: asciidoctor/asciidoctorj#401

As there are many, many invocations of require_relative all over the Ruby code, I guess that it is not easy to reproduce this problem with a trivial test program (at least not if you don't know the reason for the error).

I created a small gradle build that reproduces the error:

repositories {
    jcenter()
}

configurations {
    run
}

dependencies {
    run 'org.asciidoctor:asciidoctorj:1.5.3.2'
    run 'org.asciidoctor:asciidoctorj-diagram:1.3.1'
    run 'org.jruby:jruby-complete:1.7.22'
}

task createTestDoc << {
    new File('test.adoc').text = '''= Test document

Test''' 
}

task runTest(type: JavaExec, dependsOn: createTestDoc) {
    classpath = configurations.run
    main = 'org.asciidoctor.cli.AsciidoctorInvoker'
    args '-r', 'asciidoctor-diagram', 'test.adoc'
}

Running gradle rT will produce the error mentioned above.
Setting the jruby version to 1.7.21 will successfully render the document.

@mkristian
Copy link
Member

this will be fixed with jruby-1.7.23 releasing this week.

@mkristian mkristian added this to the JRuby 1.7.23 milestone Nov 16, 2015
@mkristian mkristian self-assigned this Nov 16, 2015
@mkristian
Copy link
Member

I backported all the patches from master to jruby-1_7 but did not test this gradle script on windows.

@robertpanzer
Copy link
Author

Is it possible to get a snapshot build of 1.7.23-SNAPSHOT so that I could try that?

@mkristian
Copy link
Member

https://oss.sonatype.org/content/repositories/snapshots/org/jruby/jruby-complete/

I tried to run it on my windows VM but it died while I was away from the laptop

@mkristian
Copy link
Member

finally got it to work after using an VPN in the US :)

fixed.

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

2 participants