gem install watir not working

Deadly 提交于 2019-12-04 19:37:08

For some reason your Ruby tries to install pre-release version of Nokogiri, which should not happen usually without explicitly trying to install some. I think it might be related with the Ruby version you're having there.

However, try installing some older version of Nokogiri before installing Watir:

gem install nokogiri -v "1.5.9"
gem install watir

If that does not work, then upgrade your Ruby to 1.9.3 or 2.0.0 instead of 1.9.2 and try again. Don't forget to install DevKit again if you're changing Ruby versions!

ERROR: While executing gem ... (Errno::EINVAL) Invalid argument - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mini_magick-3.6.0/tes t/files/special! "chars'.gif – oecprashant

this can be solved by executing gem install mini_magick -v 3.5

then try gem install watir again

You need to install the RubyInstaller Development Kit from:

HERE

When you've installed that, Watir would install succesfully.


Put this in your gemfile and do bundle install:

gem "watir", "~> 4.0.2"

That could fix it. But I'm not 100% sure.

watir requires nokogiri, and as the error says,

libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokog
iri.html for help with installing dependencies.

You should install libxml2 for nokogiri.
You can download it form ftp://xmlsoft.org/libxml2/

nokogiri installation manual: Installing Nokogiri

In windows the ruby development environment might occurred some error as XXXX is missing. To download the XXXX is a palliative method. http://railsinstaller.org/ This is my solution for ruby development environment in windows. It may not be the best choice. But I think the railsinstaller would be helpful. The best solution is to migrate to linux or mac.

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