Jruby and Cocaine 0.3.2: Errno::ECHILD: No child processes - No child processes #24

dalizard opened this Issue Sep 12, 2012 · 5 comments


None yet

4 participants


Hi guys,

I have come to the following problem with jruby and the latest version of the gem:

     Failure/Error: photo.generate_version_for!(style_name)
       No child processes - No child processes
     # org/jruby/RubyProcess.java:512:in `waitpid'
     # org/jruby/RubyProcess.java:497:in `waitpid'
     # org/jruby/RubyArray.java:1615:in `each'
     # org/jruby/RubyEnumerable.java:830:in `inject'
     # org/jruby/RubyHash.java:1186:in `each'
     # org/jruby/RubyBasicObject.java:1698:in `__send__'
     # org/jruby/RubyKernel.java:2097:in `send'
     # org/jruby/RubyBasicObject.java:1704:in `__send__'
     # org/jruby/RubyKernel.java:2101:in `send'
     # org/jruby/RubyBasicObject.java:1698:in `__send__'
     # org/jruby/RubyKernel.java:2097:in `send'
     # org/jruby/RubyBasicObject.java:1704:in `__send__'
     # org/jruby/RubyKernel.java:2101:in `send'

The problem is also discussed here http://stackoverflow.com/questions/12387405/paperclip-with-jruby and a monkey-patch is proposed in the answers section.

jyurek commented Sep 14, 2012

That's odd. I thought I posted a comment here after I replied to the SO post. Hmm. Anyway, I pushed an accessor to master that will allow you to manually override the Runner.

Cocaine::CommandLine.runner = BackticksRunner.new

I don't know why jruby is reporting that Process.spawn is available when it's not, but at least we have a workaround.

heisee commented Sep 17, 2012

JRuby is not waiting until a Process.spawn call returns from the called process, but it returns immediately (similar to IO.popen described here):

jyurek commented Sep 21, 2012

Thanks for the link there, @helsee. Since you posted that, Charles Nutter has updated JRuby and hopefully fixed that bug. In the meantime, this can be worked around in the manner I mentioned above. I'm going to close this as it looks like a JRuby problem. But if it pops up again, please let me know.

@jyurek jyurek closed this Sep 21, 2012
lapenya commented Jan 18, 2013

happens when running:

Cocaine::CommandLine.new("identify -format %wx%h /home/pablo/1casa_logo.jpg").run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment