guard / guard-spork

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

Can't convert Hash into String when starting spork via Guard #54

Closed derekprior closed 12 years ago

derekprior commented 12 years ago

I've started getting the error in the title when starting guard-spork. I can start spork directly and my other guards seem to run fine. I've reduced my Guardfile to:

guard 'spork' do
end

And still get the following stack trace when starting up:


...lib/guard/spork/spork_instance.rb:28:in `exec': can't convert Hash into String (TypeError)
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-spork-0.4.0/lib/guard/spork/spork_instance.rb:28:in `start'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-spork-0.4.0/lib/guard/spork/spork_instance.rb:27:in `fork'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-spork-0.4.0/lib/guard/spork/spork_instance.rb:27:in `start'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard/dsl.rb:117:in `to_proc'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-spork-0.4.0/lib/guard/spork/runner.rb:25:in `each'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-spork-0.4.0/lib/guard/spork/runner.rb:25:in `launch_sporks'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-spork-0.4.0/lib/guard/spork.rb:23:in `start'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:322:in `send'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:322:in `run_supervised_task'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:320:in `catch'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:320:in `run_supervised_task'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:153:in `start'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:254:in `run_on_guards'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:253:in `each'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:253:in `run_on_guards'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:252:in `catch'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:252:in `run_on_guards'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:251:in `each'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:251:in `run_on_guards'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard.rb:152:in `start'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/lib/guard/cli.rb:68:in `start'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/gems/guard-0.8.8/bin/guard:6
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/bin/guard:19:in `load'
    from /Users/dprior/code/p4/sand/vendor/bundle/ruby/1.8/bin/guard:19

It's possible I'm doing something silly, but this was previously working.

derekprior commented 12 years ago

Rolling back to 0.3.2 fixed the issue. I suspect that this commit introduced the issue.

thibaudgg commented 12 years ago

@Mange do you have any idea from where it comes?

derekprior commented 12 years ago

FWIW, I ran into this on REE 1.8.7, but I don't see any 1.9 specific code in the commit, so I don't think that's it.

On Fri, Dec 9, 2011 at 2:46 PM, Thibaud Guillaume-Gentil reply@reply.github.com wrote:

@Mange do you have any idea from where it comes?


Reply to this email directly or view it on GitHub: https://github.com/guard/guard-spork/issues/54#issuecomment-3084471

Mange commented 12 years ago

Seems like I'm not calling env_exec in the fork, but instead calling the 1.9-specific version of exec. How it happened, I don't know. I was sure of specing this correctly.

Mange commented 12 years ago

Ah, I was abscent-minded and didn't follow through with a method renaming I was doing. The method was originally called exec, but I decided to rename it to env_exec to make stuff clearer. I forgot to change all the places where the method was called.

thibaudgg commented 12 years ago

Ok, can you please submit a little pull request to fix that? Thanks @Mange!

thibaudgg commented 12 years ago

Should be fixed now, thanks @Mange for your kick pull request!