jruby gem错误win32-rsense服务

时间:2011-07-12 11:50:31

标签: emacs rubygems jruby

我正在尝试安装Rsense,我正在按照Rsense Docs

的说明进行操作

已设置RSENSE_HOME但我无法安装jruby win32-service来完成启动时启动rsense服务的步骤。

这是完整的错误,我还运行错误建议指定jruby版本。有关完成安装的任何想法吗?

C:\Users\RenshawFamily>echo %RSENSE_HOME%
C:\Rsense

C:\Users\RenshawFamily>jruby -S gem install win32-service
Fetching: win32-api-1.4.8.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing win32-service:
    ERROR: Failed to build gem native extension.

    c:/jruby-1.6.3/bin/jruby.exe extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very wel
l.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
checking for strncpy_s()... IOError: Cannot run program "cc" (in directory "C:\j
ruby-1.6.3\lib\ruby\gems\1.8\gems\win32-api-1.4.8\ext"): CreateProcess error=2,
The system cannot find the file specified
     popen at org/jruby/RubyIO.java:3540
    xpopen at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:323
      open at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:260
    xpopen at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:316
 egrep_cpp at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:538
 have_func at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:758
checking_for at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:652
  postpone at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:286
      open at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:260
  postpone at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:286
      open at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:260
  postpone at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:282
checking_for at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:651
 have_func at c:/jruby-1.6.3/lib/ruby/site_ruby/shared/mkmf.rb:755
    (root) at extconf.rb:9
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=c:/jruby-1.6.3/bin/jruby


Gem files will remain installed in c:/jruby-1.6.3/lib/ruby/gems/1.8/gems/win32-a
pi-1.4.8 for inspection.
Results logged to c:/jruby-1.6.3/lib/ruby/gems/1.8/gems/win32-api-1.4.8/ext/gem_
make.out

C:\Users\RenshawFamily>jruby -S gem install win32-service --ruby=c:/jruby-1.6.3/
bin/jruby
ERROR:  While executing gem ... (OptionParser::InvalidOption)
invalid option: --ruby=c:/jruby-1.6.3/bin/jruby

2 个答案:

答案 0 :(得分:0)

win32-service使用C扩展名。使用C扩展的gem通常与JRuby不兼容,尽管正在努力解决这个问题 - see here for background

您是否可以将MRI / CRuby用于您的项目?

或者你可以使用基于java的服务管理库,但那可能不适用于emacs / rsense。

或者你可以卷起袖子让win32-service JRuby兼容!

答案 1 :(得分:0)

安装win-32-service gem时遇到了同样的问题。这解决了它:

gem install win32-service --platform=mswin32

所以你的命令应该是

jruby -S gem install win32-service --platform=mswin32

虽然我猜这里。