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

Problems running on Windows #83

Closed
lask79 opened this issue Nov 23, 2014 · 32 comments
Closed

Problems running on Windows #83

lask79 opened this issue Nov 23, 2014 · 32 comments

Comments

@lask79
Copy link

lask79 commented Nov 23, 2014

Hi,

I am facing some problems when trying to get this example to run on my Windows machine:
http://mrhaki.blogspot.de/2014/11/awesome-asciidoctor-use-asciidoctor.html

I am getting the following error:

Installing asciidoctor-diagram-1.2.0.gem,asciidoctor-1.5.1.gem
Starting process 'command 'D:\java\jdk\bin\java.exe''. Working directory: D:\workspaces\developer-guide\documentation-template-gradle 
 Command: D:\java\jdk\bin\java.exe -Dfile.encoding=windows-1252 -Duser.country=DE 
 -Duser.language=de -Duser.variant -cp C:\Users\FOX0R5N\gradle\caches\modules-2\files-2.1\org.jruby\jruby-complete\1.7.15\4d9cb332bad3633c9c23a720542f456dc0c58a81\jruby-complete-1.7.15.jar 
 org.jruby.Main -S gem install 
 C:\Users\FOX0R5N\gradle\caches\modules-2\files-2.1\rubygems\asciidoctor-diagram\1.2.0\fd145b1eee21bca7bac8b4c090d1f5ec9a6e30dd\asciidoctor-diagram-1.2.0.gem 
 C:\Users\FOX0R5N\gradle\caches\modules-2\files-2.1\rubygems\asciidoctor\1.5.1\ba1b5e87fbbbdcdbf97ccd98fc57ce494743f439\asciidoctor-1.5.1.gem 
 --ignore-dependencies --install-dir=D:\workspaces\developer-guide\documentation-template-gradle\build\vendor
  -N --platform=java
Successfully started process 'command 'D:\java\jdk\bin\java.exe''
ERROR:  Loading command: install (LoadError)
    Could not load FFI Provider: (NotImplementedError) FFI not available: null
 See http://jira.codehaus.org/browse/JRUBY-4583
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

It seems JRuby can not install the gems because the folder "build/vendors" is still empty. But when I try to install them in the command client with the same input it works:

D:\java\jdk\bin\java.exe -Dfile.encoding=windows-1252 -Duser.country=DE -Duser.language=de -Duser.variant -cp C:\Users\FOX0R5N\gradle\caches\modules-2\files-2.1\org.jruby\jruby-complete\1.7.15\4d9cb332bad3633c9c23a720542f456dc0c58a81\jruby-complete-1.7.15.jar org.jruby.Main -S gem install C:\Users\FOX0R5N\gradle\caches\modules-2\files-2.1\rubygems\asciidoctor-diagram\1.2.0\fd145b1eee21bca7bac8b4c090d1f5ec9a6e30dd\asciidoctor-diagram-1.2.0.gem C:\Users\FOX0R5N\gradle\caches\modules-2\files-2.1\rubygems\asciidoctor\1.5.1\ba1b5e87fbbbdcdbf97ccd98fc57ce494743f439\asciidoctor-1.5.1.gem --ignore-dependencies --install-dir=D:\workspaces\developer-guide\documentation-template-gradle\build\vendor -N --platform=java

I also found out that I can run the gradle build when I start my console with "Run as Administrator". Most of my collegues do not have admin rights on their machine so this is not an option for us.

Do you have any Ideas how I can run this build without admin rights?

Regards
Lasse

@ysb33r
Copy link
Contributor

ysb33r commented Nov 23, 2014

Hi @lask79,

It seems JRuby can not install the gems because the folder "build/vendors" is still empty. But when I try to install them in the command client with the same input it works:

For interest sake, does it actually work if you manually create build/vendors before running gradle?

@lask79
Copy link
Author

lask79 commented Nov 23, 2014

No, this folder exists the whole time. As I mentioned before it is running inside a CMD with Run as Administrator or when I call the JRuby gem install manually.

@lask79 lask79 closed this as completed Nov 23, 2014
@rtyler
Copy link
Member

rtyler commented Nov 23, 2014

@lask79 is this bug really closed? I don't think we've actually fixed anything :P

@lask79 lask79 reopened this Nov 23, 2014
@lask79
Copy link
Author

lask79 commented Nov 23, 2014

Hmm, I wish it could be fixed by just pressing the wrong button ;-)

@ysb33r
Copy link
Contributor

ysb33r commented Nov 23, 2014

For sanity, can you clarify which version of if the jruby-gradle-plugin you were using.

@lask79
Copy link
Author

lask79 commented Nov 23, 2014

Sure, I tried several versions from 0.1.2 to 0.1.9.

@robertpanzer
Copy link

I have the same problem building the current AsciidoctorJ on Windows7.
It uses jruby-gradle 0.1.9.

@rtyler
Copy link
Member

rtyler commented Dec 15, 2014

Interesting, good to know @robertpanzer. I'll try to get a Windows machine up in AWS to reproduce and debug this issue

@mojavelinux
Copy link
Contributor

Keep in mind that for testing on Windows, you can use the Modern IE virtual machine images. IMO, it's the fastest way to get a Windows box on your non-Windows machine.

As for tests, we should definitely get the JRuby plugin running on AppVeyor. Setup is extremely simple. You create a YAML file much like Travis and it handles the rest. You can even use the web-based wizard to create the appveyor.yml file.

See http://www.appveyor.com/

Here's the config for Asciidoctor for reference: https://github.com/asciidoctor/asciidoctor/blob/master/appveyor.yml

@ysb33r
Copy link
Contributor

ysb33r commented Dec 20, 2014

Appveyor support is in (#92). However, @mojavelinux , do you know if there is a way of using the github organisation account on Appveyor rather than my own account?

@ysb33r
Copy link
Contributor

ysb33r commented Dec 20, 2014

Good (??) news is that I have been able to reproduce the issue that @lask79 was referring to.

@ysb33r
Copy link
Contributor

ysb33r commented Dec 20, 2014

Unlike @lask79, I do not even get it to run gem from the command-line when using jruby 1.7.16

E:\asciidoctor-issue>"C:\Program Files\Java\jdk1.8.0_25\bin\java.exe" -Dfile.encoding=windows-1252  
   -cp C:\Users\IEUser\.gradle\caches\modules-2\files-2.1\org.jruby\jruby-complete\1.7.16
          \8ef6c848cc5491c5f22ddad4532c68fe778421f6\jruby-complete-1.7.16.jar 
   org.jruby.Main -S gem
jruby: No such file or directory -- gem (LoadError)

(lines broken for readability)

When run with 1.7.17 it installs from the command-line.

@ysb33r
Copy link
Contributor

ysb33r commented Dec 20, 2014

Just to add to it, the problem has nothing to do with Asciidoctor, Even a Gradle script as simple as

buildscript {
  repositories {
    jcenter()
  }

  dependencies {
    classpath 'com.github.jruby-gradle:jruby-gradle-plugin:0.1.10'
  }
}

apply plugin: 'com.github.jruby-gradle.base'

dependencies {
  gems 'rubygems:asciidoctor-diagram:1.2.0'
}

reproduces the problem (tested with Gradle 2.0 & 2.2).

(Which bugs me, as we are not seeing this problem in the integration tests).

@ysb33r
Copy link
Contributor

ysb33r commented Dec 20, 2014

Actually, it is reproducible in the integration tests on a local 32-bit VM (but not on Appveyor)

@mojavelinux
Copy link
Contributor

I haven't looked into how to setup an organization on AppVeyor. We can
always switch. What's important is that, at the very least, it responds to
appveyor.yml.

@ysb33r
Copy link
Contributor

ysb33r commented Dec 20, 2014

The problem is related to the environment, specifically to the way that it is run to install GEMs. See
https://github.com/jruby-gradle/jruby-gradle-plugin/blob/master/src/main/groovy/com/github/jrubygradle/GemUtils.groovy#L90.

At this point I suspect it might be related to the fact that PATH becomes unset in Windows.

@ysb33r ysb33r added the bug label Dec 20, 2014
@ysb33r ysb33r added this to the 0.1.11 milestone Dec 20, 2014
@ysb33r
Copy link
Contributor

ysb33r commented Dec 20, 2014

Issue is that neither TMP not TEMP is available in the environment when the install process is run.

@ysb33r ysb33r closed this as completed in 3147226 Dec 20, 2014
@mojavelinux
Copy link
Contributor

What's strange is that the AsciidoctorJ builds work on AppVeyor using the 0.1.0 release of the JRuby Gradle plugin. We are expecting this build to fail. Any idea why it works and how to break it?

https://ci.appveyor.com/project/asciidoctor/asciidoctorj

Do I need to unset TMP and TEMP?

@mojavelinux
Copy link
Contributor

...or is it because it's fixed in JRuby 1.7.17?

@mojavelinux
Copy link
Contributor

Also, this argument worries me:

-Dfile.encoding=windows-1252

Can we force that to be UTF-8?

@ysb33r
Copy link
Contributor

ysb33r commented Dec 21, 2014

What's strange is that the AsciidoctorJ builds work on AppVeyor using the 0.1.0 release of the JRuby Gradle plugin. We are expecting this build to fail. Any idea why it works and how to break it?

The builds passed on Appveyor, even though it failed locally. This being with our Appveyour setup using both 32-bt and 64-bit JDKs. The only thing that I have seen in common is that both @robertpanzer and I had failed builds on Windows 7. I am not sure what OS Appveyor runs on by default.

@mojavelinux
Copy link
Contributor

AppVeyor is Windows Server 2012 by default.

Perhaps we need to unset TMP & TEMP?

@ysb33r
Copy link
Contributor

ysb33r commented Dec 21, 2014

Also, this argument worries me:

-Dfile.encoding=windows-1252

Can we force that to be UTF-8?

I have noticed that. It seems to be a Gradle default. I'll see if i can use systemProperties to override it.

@ysb33r
Copy link
Contributor

ysb33r commented Dec 21, 2014

Here's a much simpler gradle script to help reproduce the problem

https://gist.github.com/ysb33r/31419a20f77edc850e2e. Just fill in the path to a local jruby-complete*.jar as well as some gems.

@robertpanzer
Copy link

I have to mail that to my account at work because I don't have access to gist there :(

Am 21.12.2014 um 15:41 schrieb Schalk W. Cronjé [email protected]:

Here's a much simpler gradle script to help reproduce the problem

https://gist.github.com/ysb33r/31419a20f77edc850e2e. Just fill in the path to a local jruby-complete*.jar as well as some gems.


Reply to this email directly or view it on GitHub.

@ysb33r
Copy link
Contributor

ysb33r commented Dec 21, 2014

I can confirm that the problem occurs on Windows 8.1 32-bit as well.

ysb33r added a commit that referenced this issue Dec 21, 2014
@robertpanzer
Copy link

Works on my machine as well with AsciidoctorJ build.

@mojavelinux
Copy link
Contributor

👍

@ysb33r
Copy link
Contributor

ysb33r commented Dec 22, 2014

Works on my machine as well with AsciidoctorJ build.

Do you mean my fix worked?

@robertpanzer
Copy link

Yes, absolutely!

Am 22.12.2014 um 12:59 schrieb Schalk W. Cronjé [email protected]:

Works on my machine as well with AsciidoctorJ build.

Do you mean my fix worked?


Reply to this email directly or view it on GitHub.

@rtyler
Copy link
Member

rtyler commented Dec 22, 2014

@robertpanzer that's excellent! This will be in the 0.1.11 release which I plan on releasing today provided in-flight wifi allows me to :)

@mojavelinux
Copy link
Contributor

👍

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

No branches or pull requests

5 participants