Ruby can't find the method capture2e from open

2019-08-29 15:24发布

问题:

I am trying to use the script blogger.rb and I just can't get it work. It keeps giving me the error :

blogger.rb:294:in text2html': undefined methodcapture2' for Open3:Module (NoMethodError)

The script does a require Open3 in the beginning. I don't understand where is the problem ! I have no knowledge of Ruby. However, I can intelligently read and edit codes in general.

回答1:

I'd guess that you're using Ruby 1.8 but the script requires 1.9. The Open3 class in 1.8.7 has a popen3 class method and nothing else. The Ruby 1.9 Open3 has the capture2 and capture2e class methods that you're looking for. So you need to upgrade your Ruby to 1.9 or find another script.



标签: ruby rubygems