About require "rubygems"

I have faced one issue, after running the ruby code, version 1.8.7, it will report error as following,

Issue:

>ruby test.rb
test.rb:2:in `require': no such file to load -- watir (LoadError)
    from test.rb:2
>Exit code: 1

 

Solution:

Before require “watir”, add require “rubygems”.

require "rubygems"
require "watir"

posted @ 2010-07-08 11:35  NikeyL  阅读(563)  评论(0编辑  收藏  举报