代码之家  ›  专栏  ›  技术社区  ›  Michiel de Mare

JRuby在哪里查找脚本?

  •  2
  • Michiel de Mare  · 技术社区  · 15 年前

    运行命令 jruby -S spec 给出以下错误

    No such file, directory, or command -- spec
    

    规范的位置是 /usr/bin ,在路径中。安装了RSPEC。mri ruby可以找到脚本。JRuby可以找到rspec宝石。那么怎么了?

    2 回复  |  直到 13 年前
        1
  •  2
  •   Sébastien Le Callonnec    13 年前

    -S

    test_it hello /tmp

    sebastien@greystones:~$ jruby -v 
    jruby 1.6.6.dev (ruby-1.8.7-p357) (2012-01-22 9099561) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_30) [linux-amd64-java]
    sebastien@greystones:~$ jruby -S test_it
    jruby: No such file or directory -- test_it (LoadError)
    sebastien@greystones:~$ export PATH=/tmp:$PATH
    sebastien@greystones:~$ jruby -J-Djruby.debug.scriptResolution=true -S test_it
    Found: /tmp/test_it
    hello
    

    debug.scriptResolution

        2
  •  2
  •   codefinger    15 年前

    jruby -e "puts $:"
    

    jruby -I/usr/bin spec
    

    http://kenai.com/projects/jruby/pages/ClasspathAndLoadPath