jruby-complete不运行rake或其他下载的gem [英] jruby-complete not running rake or other downloaded gems

查看:57
本文介绍了jruby-complete不运行rake或其他下载的gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的指南URL中:

In following the following URL for a guide:

http://spin .atomicobject.com/2010/02/01/running-a-ruby-application-with-jruby-complete/

我下载了jruby-complete,并且能够运行一个或两个简单的基本命令.但是,我想运行Rake.发出java -jar jruby-complete.jar -S rake -T时,在Windows计算机上遇到了这些错误.

I downloaded jruby-complete and was able to run a basic simple command or two. However, I wanted to run Rake. When I issued java -jar jruby-complete.jar -S rake -T, I was greeted with these errors on my Windows machine.

λ 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
    load at org/jruby/RubyKernel.java:1059
  (root) at /C:/Users/user01/Desktop/jruby_ant_tasks/jruby-complete-1.7.21.jar!/META-INF/jruby.home/bin/rake:23

因此,请遵循以下URL以获得更多指导:

So then following this URL for more guidance:

http://spin.atomicobject.com/2013/04 /24/bundler-jruby-complete/

我创建了一个vendor\gem_home目录.然后使用以下命令安装捆绑器和rake:

I created a vendor\gem_home directory. Then installed bundler and rake using the following command:

λ 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

但是,当我执行宝石列表时,未列出Bundler

However, Bundler is not listed when I do a gem list

λ 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)

因此,我再次运行rake命令,并得到与上述相同的错误.运行bundle命令时,出现以下错误:

So then I ran the rake command again, and got the same error as above. When I run the bundle command, I get the following error:

λ 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'

这是有关我的系统的更多信息.我的Java版本是:

Here is some more information about my system. My Java version is:

λ 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版本是:

My JRuby version is:

λ 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]

我的run_jruby.bat文件包含:

λ 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% %*

我不确定我还需要做些什么,因为Wiki并没有过多地介绍这一部分.

I'm not sure what else I need to do as the Wiki didn't cover this part too much.

-2015-07-13编辑-
刚刚在带有IBM Java 1.6的RHEL 5.8中尝试了相同的设置,并且Rake命令可以正常工作,因此这似乎是Windows特有的问题.

--2015-07-13 EDIT--
Just tried this same setup in RHEL 5.8 with IBM Java 1.6, and the Rake command works just fine, so it seems to be a Windows specific issue.

推荐答案

在1.7.21构建时,这似乎是JRuby的错误.

This seemed to be a bug with JRuby at the time of 1.7.21 build.

https://github.com/jruby/jruby/issues/3133

JRuby二进制文件未检查未初始化的环境PATH变量.该问题已在JRuby的1.7.22中修复.

The JRuby binary was not checking for uninitialized environment PATH variables. The issue was fixed in 1.7.22 of JRuby.

这篇关于jruby-complete不运行rake或其他下载的gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆