0
Ruby를 사용하여 자체 로그 모니터 스크립트를 만들고 Warbler를 사용하여 JRuby를 JAR 파일로 컴파일합니다. 저는 JRuby 1.7.17 64 비트를 실행하고 있습니다. JRuby gem을 사용할 수는 없지만 JRuby는 여전히 스크립트를 실행할 수 있습니다.
monitor_log>] jruby lib\monitor_log\log_watch.rb --help
Usage: log_watch [options]
-f, --file FILE Input file to monitor
-p, --pattern PATTERN Pattern to match in the file
-h, --help Show this screen
그래서 나는 JRuby를 내 보석을 실행하는 것입니다 있는지 확인하기 위해 JBundler을 사용하여 실행하려고 시도
: 나는이를 스크립트처럼 실행할 때, MRI, 그리고 JRuby를 작동 보석
optparse
를 사용하려고 해요
monitor_log>] jbundle exec jruby bin/log_watch.rb --help
Usage: log_watch [options]
-f, --file FILE Input file to monitor
-p, --pattern PATTERN Pattern to match in the file
-h, --help Show this screen
그렇다면 Warbler를 사용하여이를 JAR로 컴파일하려고 시도했습니다. 내가 얻을 :
monitor_log>] warble executable jar
warble aborted!
Bundler::GemNotFound: Could not find gem 'optparse (>= 0) java' in the gems available on this machine.
c:\Ruby\jruby-1.7.17\bin\warble:23:in `(root)'
(See full trace by running task with --trace)
나는 어쩌면 JRuby를 기본적으로이 없었 생각, 그래서 나는 그래서, 보석에 대한
monitor_log>] jruby -S gem search optparse
*** REMOTE GEMS ***
micro-optparse (1.2.0)
optparse-command (0.1.8)
optparse-defaults (0.1.0)
optparse-lite (0.0.0)
optparse-off (0.0.1)
optparse-pathname (0.0.1)
optparse-range (0.0.3)
optparse-simple (0.4.2)
optparse_ex (0.0.4)
pickled_optparse (0.1.1)
remi-optparse-simple (0.1.0)
rubysl-optparse (2.0.1)
subcommand-optparse (0.0.3)
검색 시도하지만, 실제 분명 아무것도 나에게 눈에 띄었다 없습니다. 내가 제대로하고있는 게 없니? gemspec에 개발 종속성 및 런타임 종속성으로 젬 (optparse
)을 추가했습니다. 내가 그 일을하지 않거나 내가 놓친 다른 것이 있습니까?
spec.add_development_dependency "optparse"
spec.add_runtime_dependency "optparse"
제거
는