Jruby - Foreman Gem没有跑

时间:2012-01-22 19:23:39

标签: java jruby

我正在运行JRUBY应用。并且偶然发现了一颗叫做Foreman的伟大宝石: https://github.com/ddollar/foreman

但是我发现 - JVM不支持分叉:

 foreman startNotImplementedError: fork is not available on this platform
              fork at org/jruby/RubyKernel.java:1657
      fork_with_io at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/process.rb:32
       run_process at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/process.rb:44
               run at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/process.rb:19
  with_environment at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/process.rb:64
               run at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/process.rb:18
             chdir at org/jruby/RubyDir.java:466
               run at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/process.rb:17
             spawn at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/procfile_entry.rb:17
               map at org/jruby/RubyArray.java:2336
             spawn at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/procfile_entry.rb:15
   spawn_processes at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/engine.rb:63
              each at org/jruby/RubyArray.java:1609
   spawn_processes at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/engine.rb:61
             start at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/engine.rb:45
             start at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/lib/foreman/cli.rb:28
          __send__ at org/jruby/RubyBasicObject.java:1772
              send at org/jruby/RubyKernel.java:1972
               run at /home/charlie/.rvm/gems/jruby-head/gems/thor-0.14.6/lib/thor/task.rb:21
       invoke_task at /home/charlie/.rvm/gems/jruby-head/gems/thor-0.14.6/lib/thor/invocation.rb:118
          dispatch at /home/charlie/.rvm/gems/jruby-head/gems/thor-0.14.6/lib/thor.rb:263
             start at /home/charlie/.rvm/gems/jruby-head/gems/thor-0.14.6/lib/thor/base.rb:389
            (root) at /home/charlie/.rvm/gems/jruby-head/gems/foreman-0.36.1/bin/foreman:7
              load at org/jruby/RubyKernel.java:996
            (root) at /home/charlie/.rvm/gems/jruby-head/bin/foreman:19

这是一种耻辱,因为我喜欢运行Foreman的想法。有没有人知道解决上述问题,或者在JRUBY环境中运行的替代方案

2 个答案:

答案 0 :(得分:2)

感谢这个宝石创作者的精彩作品,现在可以在Jruby中找到

https://github.com/ddollar/foreman

在Jruby 1.6.6中正常运行

答案 1 :(得分:0)

另外几个选项是RVM包装器和Guard :: Process,如下所述:http://www.without-brains.net/blog/2011/09/21/using-foreman-to-run-jruby-with-rvm-and-mri/