要求selenium-webdriver不起作用

时间:2015-05-28 16:04:44

标签: ruby selenium windows-7 irb

我在irb中使用require“selenium-webdriver”时遇到错误。我在Windows 7 x64上使用Ruby 2.2.1 x64,我在C:\ Ruby221-x64 \ lib \ ruby​​ \ gems \ 2.2.0 \ gems

中安装了selenium webdriver gem

错误如下

 irb(main):002:0> require "selenium-webdriver"
    LoadError: cannot load such file -- selenium-webdriver
    from C:/Ruby221-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:5
    4:in `require'
    from C:/Ruby221-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:5
    4:in `require'
        from (irb):2
        from C:/Ruby221-x64/bin/irb:11:in `<main>'
   irb(main):003:0> require "selenium-webdriver"
   LoadError: cannot load such file -- selenium-webdriver
        from C:/Ruby221-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:5
        4:in `require'
        from C:/Ruby221-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:5
        4:in `require'
        from (irb):3
        from C:/Ruby221-x64/bin/irb:11:in `<main>'
irb(main):004:0>

1 个答案:

答案 0 :(得分:0)

请试试这个。这对我有用。

gem update --system