开发者

Ruby 1.9 - no such file to load 'win32/open3'

开发者 https://www.devze.com 2023-02-08 23:42 出处:网络
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:

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:

  1. Installed POpen4 via gem install POpen4
  2. Required POpen4 via require 'popen4'
  3. 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:

  1. Add this to the Gemfile -> gem 'win32-open3-19', :platforms => :mingw
  2. Run bundle to install win32-open3-19

That was it. For me the git location was unncessary and didn't work.

0

精彩评论

暂无评论...
验证码 换一张
取 消