无法从命令提示符运行file.rb

时间:2015-10-14 14:03:50

标签: ruby watir watir-classic

我有Ruby 2.2,每次遇到同样的错误时,我都无法从命令提示符运行任何文件.rb:

C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- dl/import (LoadError)
        from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/watir-classic-4.2.0/lib/watir-classic/win32.rb:1:in `<top (required)>'
        from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/watir-classic-4.2.0/lib/watir-classic.rb:32:in `<top (required)>'
        from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/watir-5.0.0-x86-mingw32/lib/watir/loader.rb:41:in `load_driver'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/watir-5.0.0-x86-mingw32/lib/watir/loader.rb:33:in `load_driver_for'
        from C:/Ruby22/lib/ruby/gems/2.2.0/gems/watir-5.0.0-x86-mingw32/lib/watir/loader.rb:14:in `start'
        from test.rb:2:in `<main>'

我该怎么办?

1 个答案:

答案 0 :(得分:0)

试试这个:

gem install net-ssh -v 2.9.3.beta1