我尝试在fedora linux上安装watir-webdriver。我跑了这个命令:
cat << EOF > /etc/yum.repos.d/ruby.repo
[ruby]
name=ruby for Fedora \$releasever - \$basearch - Base
baseurl=http://mirror.nl.ergo-project.org/repositories/custom-f13-ruby/x86_64/
failovermethod=priority
enabled=1
gpgcheck=0
[ruby-extra]
name=ruby extra for Fedora \$releasever - \$basearch - Base
baseurl=http://mirror.nl.ergo-project.org/repositories/feature-f13-ruby-1.9.1/x86_64/
failovermethod=priority
enabled=1
gpgcheck=0
EOF
yum -y --enablerepo=ruby,ruby-extra install ruby ruby-devel ruby-irb
gem update --system
gem install watir-webdriver
但是当我运行official website上可用的默认脚本但我有错误
./firewatir:3:in `require': no such file to load -- watir-webdriver (LoadError)
from ./firewatir:3:in `<main>'
有人能帮助我吗?
答案 0 :(得分:3)
由于您已将库安装为gem,因此需要在watir-webdriver之前加载Rubygems,即:
require "rubygems"
require "watir-webdriver"