watir - installation

匿名 (未验证) 提交于 2019-12-03 02:56:01

问题:

I have installed Ruby 2, devkit & Watir. I am getting the following error. Can anyone please help me resolve this issue?

C:\devkit>irb DL is deprecated, please use Fiddle irb(main):001:0> require "watir" => true  irb(main):002:0> browser = Watir::Browser.new  LoadError: cannot load such file -- watir-classic from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require' from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in`require' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/watir-4.0.2/lib/watir/loader.rb:48:in `load_driver' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/watir-4.0.2/lib/watir/loader.rb:40:in `load_driver_for' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/watir-4.0.2/lib/watir/loader.rb:8:in `new' from (irb):2 from C:/Ruby200/bin/irb:12:in `<main>' irb(main):003:0> 

回答1:



回答2:

I'm assuming you're talking about using Watir on a Windows machine. From my experience installing Ruby in the correct way is the most difficult part.

First of all, install everything as if you're on a 32 bit system. The 64 bit installation often brings unwanted issues.

That said, the ffi gem can also cause issues, so you'll have to uninstall it, and re-install with specific tags:

gem uninstall ffi gem install ffi --platform ruby 

Finally, the error that is showing LoadError: cannot load such file -- watir-classic simply means that what you're doing is trying to make use of a certain gem that is not there. In this case watir-classic, so the following should fix that:

gem install watir-classic 

A complete guide on installing Watir on Windows



文章来源: watir - installation
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!