這是我的第一個程序:錯誤在運行IRB文件
require 'rubygems'
require 'watir'
ie = Watir::IE.new
ie.goto("http://www.google.com")
ie.text_field(:name, "question").set("microsoft")
ie.button(:name, "btnG").click
當我運行它,我得到以下錯誤,請你幫忙。我運行此
C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- watir (LoadError)
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from C:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/FirstSample:2:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
看起來不像你在IRB是。進入IRB並將「require watir」放在引號中,然後嘗試「require watir-webdriver」 – 2013-03-25 15:24:47