guard / guard-spork

Guard::Spork automatically manage Spork DRb servers
https://rubygems.org/gems/guard-spork
MIT License
296 stars 58 forks source link

JRuby and guard-spork #26

Closed rcyrus closed 13 years ago

rcyrus commented 13 years ago

Trying to run guard-spork under JRuby. guard-spork: 0.2.1 guard: 0.5.1 spork: 0.9.0.rc9 JRuby: 1.6.3, in 1.9 mode installed via rvm.

I get this error message: https://gist.github.com/1111920

The guard file is default from: guard init spork

Any ideas? Some sort of JRuby flag i need to set to make this work?

thibaudgg commented 13 years ago

Guard actually don't support JRuby, but please can you tried it with Guard branch master.

rcyrus commented 13 years ago

I didn't think guard did support JRuby. I just saw that your plugin was tested for JRuby so I thought perhaps you had worked some sort of magic to get it to work.

The above results were from guard master. I cloned and built a new gem manually and still got the same results.

I guess won't be using guard or guard-spork :-(

docwhat commented 13 years ago

Odd....because I'm running guard happily with jruby. I can also use spork with rspec on jruby (haven't bothered trying to get cucumber to work).

But guard-spork doesn't work....

The signal QUIT is in use by the JVM and will not work correctly on this platform
Guard is now watching at '/Users/docwhat/projects/iated'
Starting Spork for RSpec & Cucumber 
ERROR: Guard::Spork failed to achieve its <start>, exception was:
NotImplementedError: fork is not available on this platform
org/jruby/RubyKernel.java:1792:in `fork'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/guard-spork-0.2.1/lib/guard/spork/runner.rb:38:in `spawn_child'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/guard-spork-0.2.1/lib/guard/spork/runner.rb:25:in `launch_sporks'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/guard-spork-0.2.1/lib/guard/spork.rb:17:in `start'
org/jruby/RubyKernel.java:2092:in `send'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/guard-0.6.2/lib/guard.rb:66:in `supervised_task'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/guard-0.6.2/lib/guard.rb:43:in `start'
org/jruby/RubyArray.java:1603:in `each'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/guard-0.6.2/lib/guard.rb:43:in `start'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/guard-0.6.2/lib/guard/cli.rb:17:in `start'
org/jruby/RubyKernel.java:2092:in `send'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/thor-0.14.6/lib/thor/task.rb:21:in `run'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/gems/guard-0.6.2/bin/guard:6:in `(root)'
org/jruby/RubyKernel.java:1063:in `load'
/Users/docwhat/projects/iated/.bundle/jruby/1.8/bin/guard:19:in `(root)'

Guard::Spork has just been fired
Running all features
...

You can check out my project at http://github.com/docwhat/iated and then just uncomment the spork stuff in Guardfile and in the Gemfile

As is, bundle exec rspec spec works with Drb if you've run bundle exec spork on another terminal.

Though I'm using jruby in 1.8 mode (I think...that's the default, right?)

thibaudgg commented 13 years ago

It's known that posix Signals (like QUIT) aren't well supported on jruby so Guard isn't compatible yet (but it should be coming).

docwhat commented 13 years ago

Huh. It works with spork without guard-spork. I don't know enough about guard to know why it needs signals like SIGQUIT.

thibaudgg commented 13 years ago

At the moment it's the only way to interact with Guard (reloading, run_all), but it's on my todo list to replace it by something better and having jruby supported. I have begun a trial here https://github.com/guard/guard/tree/stdin, any help are welcome :)