Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using fork in Windows with Ruby

Tags:

ruby

When I call Kernel.fork() on Windows, I get this error:

!! Unexpected error while processing request: fork() function is unimplemented on this machine

Is there an alternative way to fork while on Windows?

like image 439
RyanScottLewis Avatar asked May 13 '11 21:05

RyanScottLewis


2 Answers

Try spawn() - it's implemented for windows.

like image 126
Derek Avatar answered Nov 15 '22 18:11

Derek


While the Windows OS does not support fork, the win32-process gem appears to support a substitute. Apparently there are some differences from the unix version though, see this question: fork with Ruby 1.8 and Windows

like image 42
AShelly Avatar answered Nov 15 '22 20:11

AShelly