I'm running ruby 1.9.2 on Windows and am trying to port code that worked in Ruby 1.8. The code uses Open4.popen4 which previously worked fine. With 1.9.2 I h开发者_开发问答ave done the following:
- Installed POpen4 via
gem install POpen4
- Required POpen4 via
require 'popen4'
- Attempted to use POpen4 like:
Open4.popen4("cmd") {|io_in,io_out,io_er| ... }
When I do, I get the error:
no such file to load -- win32/open3
If I try and install win32-open3 (gem install win32-open3
) I get the error:
win32-open3 requires Ruby version < 1.9.0
Does anyone know how I get around this problem?
Haven't used it, but this might work: https://github.com/matschaffer/win32-open3-19
Adding
gem "win32-open3-19", :platforms => :mingw, :git => "github.com/matschaffer/win32-open3-19.git"
to my Gemfile didn't exactly work.
Here are the steps that solved this for me:
- Add this to the Gemfile ->
gem 'win32-open3-19', :platforms => :mingw
- Run bundle to install win32-open3-19
That was it. For me the git location was unncessary and didn't work.
精彩评论