Ruby: Cannot Install Watir Gem On Windows

我是研究僧i 提交于 2019-12-03 21:03:44

问题


Watir's site says I need Ruby 1.8.6, which I'm running. And windows installation should be as simple as gem install watir. But when I run that, I get this:

C:\Users\Ryguy\Code>gem install watir
Building native extensions.  This could take a while...
ERROR:  Error installing watir:
        ERROR: Failed to build gem native extension.

C:/Ruby/bin/ruby.exe extconf.rb
checking for strncpy_s()... no
creating Makefile

make
'make' is not recognized as an internal or external command,
operable program or batch file.


Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/win32-api-1.4.5 f
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/win32-api-1.4.5/ext/gem_make.out

My Ruby Version: ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]
My RubyGems Version: 1.3.5


回答1:


I would recommend you install the RubyInstaller Development Kit as documented here

Once you've installed it, the compile process of Watir dependencies (win32-api) will install successfully.




回答2:


Turns out I needed to install the Ruby Development files. =/




回答3:


Execute Below command and its works

gem install watir --platform=mswin32




回答4:


Installed devkit and after calling the bat file on Windows 7 from a cmd it fixed this issue. Using Ruby 1.9.1




回答5:


I also had to install nokogiri to get Watir to install successfully on windows, after installing DevKit. Use: gem install nokogiri



来源:https://stackoverflow.com/questions/1948043/ruby-cannot-install-watir-gem-on-windows

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