Ruby学习笔记_watir
2014-04-13 23:50
295 查看
错误现象:
uninitialized constant Watir::IE (NameError)
解决方案:
1. gem update --system
2. gem install watir
3. gem install win32-process
4. gem install watir-classic #目前还不支持64位的Ruby所以安装的Ruby必须是32位的才能使用
第一个是对Rubygems升级,第二个是对安装watir。这两个过程都是要通过网络的。
3. 用rb文件测试:
----------------------------------------------------------------------------------------------------------------------------------------------------------
Based on the error, my guess is that watir-classic is failing to install the nokogiri gem. Nokogiri does not currently support Ruby x64 on Windows - see https://github.com/sparklemotion/nokogiri/issues/864.
Two things you could try:
1. Use 32bit Ruby (as suggested in the Nokogiri issue)
2. Use a browser other than IE. By default, Browser.new will start IE using watir-classic. Using one of the other browsers will use watir-webdriver, which I do not believe is dependent on nokogiri.
Example:
uninitialized constant Watir::IE (NameError)
解决方案:
1. gem update --system
2. gem install watir
3. gem install win32-process
4. gem install watir-classic #目前还不支持64位的Ruby所以安装的Ruby必须是32位的才能使用
第一个是对Rubygems升级,第二个是对安装watir。这两个过程都是要通过网络的。
3. 用rb文件测试:
require 'rubygems' require 'watir' require 'watir-classic' ie = Watir::Browser.new ie.goto("http://www.baidu.com")如果ie被打开就Ok。
----------------------------------------------------------------------------------------------------------------------------------------------------------
Based on the error, my guess is that watir-classic is failing to install the nokogiri gem. Nokogiri does not currently support Ruby x64 on Windows - see https://github.com/sparklemotion/nokogiri/issues/864.
Two things you could try:
1. Use 32bit Ruby (as suggested in the Nokogiri issue)
2. Use a browser other than IE. By default, Browser.new will start IE using watir-classic. Using one of the other browsers will use watir-webdriver, which I do not believe is dependent on nokogiri.
Example:
require 'watir' browser = Watir::Browser.new :chrome browser.goto("http://www.google.com")
相关文章推荐
- RoR(Ruby on Rails)学习笔记(3)
- Ruby学习笔记-循环与选择结构
- ruby学习笔记(1)--类的属性与方法
- Ruby for Rails 学习笔记(一)
- Ruby On Rails 开发学习笔记(一)
- Ruby 学习笔记(一)
- Ruby学习笔记(1)
- Ruby On Rails学习笔记
- Ruby on Rails 学习笔记 - 3 Static Page
- [Ruby On Rails] Rails 路由学习笔记
- Ruby 学习笔记一(Ruby 安装)
- Ruby学习笔记(二)——从管道读取数据
- ruby学习笔记之include/prepend
- Ruby简洁学习笔记(二):类继承、属性、类变量
- Ruby on Rails Tutorial 学习笔记 --第六章 用户模型
- ruby 学习笔记 2 -变量
- ruby 学习笔记(四) String
- Ruby的魔法 学习笔记之一
- ruby 学习笔记method