我在 win7 和 firefox 14.0.1 上安装了 jruby1.6.7 并运行 jruby -v 是好的并安装在插件下面:
jgem install activerecord -v='3.0.5'
jgem install activerecord-jdbc-adapter -v='1.1.3'
jgem install arel -v='2.2.1'
jgem install color -v='1.4.1'
jgem install rspec -v='2.6.0'
jgem install cucumber -v='1.2.1'
jgem install i18n -v='0.6.0'
jgem install jruby-openssl -v='0.7.4'
jgem install rack -v='1.3.2'
jgem install rest-open-uri -v='1.0.0'
jgem install watir-webdriver
jgem install ruby-debug
然后我运行这个脚本:
require "rubygems";require "watir-webdriver"
browser = Watir::Browser.new :ff
browser.goto "http://www.google.com/"
puts browser.url
browser.a(:text => "Google.com in English").click
browser.a(:text => "Images").click
puts browser.title
browser.text_field(:name => "q").set "book"
browser.button(:value => "Search Images").click
puts browser.images.size
browser.close
firefox打不开也没有错误信息!但是当我在windowsxp上这样做时它起作用了