Hi All,
Have a small issue with the win32-open3 gem. I have written a code for
running commands and capturing the output and error using the
win32-open4(win32-open3-19) gem in the windows platform. This is working
properly.
Open4.popen4(command_to_be_executed) do |stdin,stdout,stderr,pid|
..... code logic
end
I also have written specs to validate the logic. When running the specs
individually like "spec spec/file_name_spec.rb" or by running on the
spec directory like "spec spec/", the specs are able to run
successfully.
Now, I wanted to invoke these specs with the rake and added a rake task
"rake spec" in the Rakefile of the root directory. when the rake spec is
run, there is an error which is being thrown telling that
"fork() function is unimplemented on this machine"
We can see that instead of the "win32-open3" functionality, the default
open3 functionality is being invoked.
Requiring the 'win32-open3' in the spec_helper, the rake file and other
dependent places also didn't work either.
Please can anybody help in this regards.
Thanks in advance for the help.
Sandy
···
--
Posted via http://www.ruby-forum.com/.
AS far as I know the windows OS doesn't support fork as in Linux,
therefore the windows implementation doesn't accept fork.
···
--
Posted via http://www.ruby-forum.com/.
Eduardo Blumenfeld wrote in post #1018018:
AS far as I know the windows OS doesn't support fork as in Linux,
therefore the windows implementation doesn't accept fork.
Hi Eduardo,
Thanks for the immediate reply. Just as you were telling, I understood
the reason for this behaviour. Now, if this is the case, the spec should
not even run individually. But I am able to run them and that too
successfully.
This fork() error comes only when I am running with the 'rake spec'. I
believe that there is some issue on the loading of open3 after the
loading of the win32-open3, so that the open3 represents the default
open3 but not the win32-open3 one. The way these are getting loaded can
be a possible area of issue.
Will update if any progress on this. In the meanwhile, please do give
suggestions for this.
Sandy
···
--
Posted via http://www.ruby-forum.com/\.
Thanks for the immediate reply. Just as you were telling, I understood
the reason for this behaviour. Now, if this is the case, the spec should
not even run individually. But I am able to run them and that too
successfully.
This fork() error comes only when I am running with the 'rake spec'. I
believe that there is some issue on the loading of open3 after the
loading of the win32-open3,
Yeah I bet loading open3 after win32-open3 is overriding its methods or
something.
···
--
Posted via http://www.ruby-forum.com/\.