【发布时间】:2018-03-18 14:30:56
【问题描述】:
我正在尝试在简短的 ruby 脚本中使用 Watir gem。当我运行脚本时:
require 'rubygems'
require 'watir-webdriver'
browser = Watir::Browser.new
browser.goto 'http://wers.tunegenie.com/'
puts browser.div(class: 'song')
我收到加载错误:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in
require': cannot load such file -- watir-webdriver (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
我在其他帖子中关注了故障排除问题(需要安装 web-driver gem,需要 rubygems)但没有运气。有什么想法吗?
【问题讨论】:
-
您确定安装了
watir-webdriver吗?运行gem list时看到了吗?