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"

你可能感兴趣的:(rubygems)