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

JRuby-Complete-1.7.21 not running Rake on WIndows 7 #3133

Closed
FilBot3 opened this issue Jul 13, 2015 · 8 comments
Closed

JRuby-Complete-1.7.21 not running Rake on WIndows 7 #3133

FilBot3 opened this issue Jul 13, 2015 · 8 comments

Comments

@FilBot3
Copy link

FilBot3 commented Jul 13, 2015

http://stackoverflow.com/q/31351099/2009612

I had already made a post on StackExchange about this. I downloaded the jruby-complete-1.7.21.jar and used Java 1.7.0u71 on Windows 7. However, I get these errors.

Java Version:

λ java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

JRuby version

λ run_jruby.bat -v
jruby 1.7.21 (1.9.3p551) 2015-07-07 a741a82 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_71-b14 +jit [Windows 7-amd64]

My script to run JRuby

λ cat run_jruby.bat
@echo off

SET JAVA_COMMAND="java"
SET JAVA_OPTIONS="-jar"
SET JRUBY_BIN="jruby-complete-1.7.21.jar"
SET GEM_HOME="vendor\gem_home"
SET GEM_PATH="vendor\gem_home"

%JAVA_COMMAND% %JAVA_OPTIONS% %JRUBY_BIN% %*

The Error:

λ run_jruby.bat -S rake -T
io/console not supported; tty will not be manipulated
LoadError: no such file to load -- file:C:/Users/user01/Desktop/jruby_ant_tasks/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/gems/shared/specifications/gems/rake-10.1.0/bin/rake

However, the Rake gem is there:

λ run_jruby.bat -S gem list --local
io/console not supported; tty will not be manipulated

*** LOCAL GEMS ***

jar-dependencies (0.1.15)
jruby-openssl (0.9.7 java)
json (1.8.0 java)
rake (10.1.0)
rdoc (4.1.2)

I am also having issues running gems I downloaded like Bundler

λ run_jruby.bat -S gem install -i vendor\gem_home\ --no-rdoc --no-ri bundler rake
io/console not supported; tty will not be manipulated
Fetching: bundler-1.10.5.gem (100%)
Successfully installed bundler-1.10.5
Fetching: rake-10.4.2.gem (100%)
Successfully installed rake-10.4.2
2 gems installed

λ run_jruby.bat -S bundle gem new_gem
ArgumentProcessor.java:565:in `resolveScript': java.lang.NullPointerException
        from ArgumentProcessor.java:523:in `runBinScript'
        from ArgumentProcessor.java:277:in `processArgument'
        from ArgumentProcessor.java:100:in `processArguments'
        from ArgumentProcessor.java:95:in `processArguments'
        from RubyInstanceConfig.java:196:in `processArguments'
        from Main.java:216:in `run'
        from Main.java:197:in `main'
@headius
Copy link
Member

headius commented Jul 16, 2015

Based on the stack trace, I'm guessing you don't have a PATH environment variable? That seems unusual. Looks like you're running cmder, yes?

I can add a safer check for PATH but it's surprising that it isn't present.

A workaround for you would be to set up the PATH env var somewhere.

@headius
Copy link
Member

headius commented Jul 16, 2015

When this build completes:

https://projectodd.ci.cloudbees.com/view/JRuby/job/jruby-1.7-dist/325/

Try a 1.7.22-SNAPSHOT build from http://ci.jruby.org and confirm it's working. Thanks!

@FilBot3
Copy link
Author

FilBot3 commented Jul 17, 2015

I could potentially setup the PATH variable in my run_jruby.bat script couldn't I? Yes, I am using Cmder, since its awsome for Windows.

@mkristian mkristian reopened this Jul 17, 2015
@FilBot3
Copy link
Author

FilBot3 commented Jul 17, 2015

This Snapshot did work for me this time. I just need to figure out to compile this into a JAR. Thanks @headius

@mkristian
Copy link
Member

there is something odd here:

file:C:/Users/user01/Desktop/jruby_ant_tasks/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/gems/shared/specifications/gems/rake-10.1.0/bin/rake

this file indeed does not exists and it should be:

file:C:/Users/user01/Desktop/jruby_ant_tasks/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/gems/shared/gems/rake-10.1.0/bin/rake

@predatorian3 I reopened the issue to make sure both cases work for you. the first case where you do NOT have rake installed but want to use the one from jruby-complete.jar and the second one with bundler command. thanx.

@FilBot3
Copy link
Author

FilBot3 commented Jul 17, 2015

@mkristian I think this is what you're asking for, correct?

C:\Users\user01\Documents\GitHub\wsi\jruby_ant_tasks
λ cat run_jruby.bat
@echo off

SET JAVA_COMMAND="java"
SET JAVA_OPTIONS="-jar"
SET JRUBY_BIN="jruby-complete-1.7.21.jar"
SET GEM_HOME="vendor\gem_home"
SET GEM_PATH="vendor\gem_home"

%JAVA_COMMAND% %JAVA_OPTIONS% %JRUBY_BIN% %*

C:\Users\user01\Documents\GitHub\wsi\jruby_ant_tasks
λ run_jruby.bat -S rake -T
io/console not supported; tty will not be manipulated
LoadError: no such file to load -- file:C:/Users/user01/Documents/GitHub/wsi/jruby_ant_tasks/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/gems/shared/specifications/gems/rake-10.1.0/bin/rake
    load at org/jruby/RubyKernel.java:1059
  (root) at /C:/Users/user01/Documents/GitHub/wsi/jruby_ant_tasks/jruby-complete-1.7.21.jar!/META-INF/jruby.home/bin/rake:23

C:\Users\user01\Documents\GitHub\wsi\jruby_ant_tasks
λ cd ..\jruby_ant_test\

C:\Users\user01\Documents\GitHub\wsi\jruby_ant_test
λ cat run_jruby.bat
@echo off

SET JAVA_COMMAND="java"
SET JAVA_OPTIONS="-jar"
SET JRUBY_BIN="jruby-complete-1.7.21.jar"
::SET GEM_HOME="vendor\gem_home"
::SET GEM_PATH="vendor\gem_home"

%JAVA_COMMAND% %JAVA_OPTIONS% %JRUBY_BIN% %*

C:\Users\user01\Documents\GitHub\wsi\jruby_ant_test
λ run_jruby.bat -S rake -T
io/console not supported; tty will not be manipulated
LoadError: no such file to load -- file:C:/Users/user01/Documents/GitHub/wsi/jruby_ant_test/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/gems/shared/specifications/gems/rake-10.1.0/bin/rake
    load at org/jruby/RubyKernel.java:1059
  (root) at /C:/Users/user01/Documents/GitHub/wsi/jruby_ant_test/jruby-complete-1.7.21.jar!/META-INF/jruby.home/bin/rake:23

C:\Users\user01\Documents\GitHub\wsi\jruby_ant_test
λ

I copied the 1.7.21 jar to a new folder without the vendor\gem_home directory, and commented out the GEM_PATH, and GEM_HOME variables in my run script.

@mkristian
Copy link
Member

not sure if you used a jruby-complete with the patch from @headius ? in case you need jruby-complete from the current jruby-1_7 branch I deployed one here: https://oss.sonatype.org/content/repositories/snapshots/org/jruby/jruby-complete/1.7.22-SNAPSHOT/

@FilBot3
Copy link
Author

FilBot3 commented Jul 17, 2015

My apologies. The above output was from the JAR provide don the jruby web page, and not the SNAPSHOT that @headius provided. Here's the output from the SNAPSHOT.

C:\Users\user01\Desktop\jruby-1.7.22-SNAPSHOT
λ bin\jruby -S rake -T -f C:\Users\user01\Documents\GitHub\wsi\jruby_ant_tasks\Rakefile
io/console not supported; tty will not be manipulated
rake clean      # Clean up compiled files
rake default    # Default Task, rake
rake make_jars  # Make the Java JARs
rake make_war   # Make a WAR file
rake run_jetty  # Run JETTY
rake run_tests  # Run Tests
rake setup      # Setup the project

So it did run the Rakefile Successfully without me downloading the Gem, and using the built-in one.

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

3 participants