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
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.
Turns out I needed to install the Ruby Development files. =/
Execute Below command and its works
gem install watir --platform=mswin32
Installed devkit and after calling the bat file on Windows 7 from a cmd it fixed this issue. Using Ruby 1.9.1
I also had to install nokogiri to get Watir to install successfully on windows, after installing DevKit. Use: gem install nokogiri
Related
I use github+jekyll to build blog, i try to install jekyll to local(windows 10), while it failed when i rungem install jekyll and the stack trace is
C:\Developments\FrontEnd\rubygems-2.7.7>gem install jekyll
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
current directory: C:/Developments/FrontEnd/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
C:/Developments/FrontEnd/Ruby25-x64/bin/ruby.exe -r ./siteconf20180806-33956-l8y76h.rb extconf.rb
creating Makefile
current directory: C:/Developments/FrontEnd/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR=" clean
'make' is not recognized as an internal or external command,
operable program or batch file.
current directory: C:/Developments/FrontEnd/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR="
'make' is not recognized as an internal or external command,
operable program or batch file.
make failed, exit code 1
what i do is:
1. install ruby, path variable was set, version: ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32].
2. install rubygems, version: 2.7.7.
3. install MSYS2.
4. install jekyll, gem install jekyll, then the above error occurs and i'm not sure the reason.
i have tried to install devkit and it not works, i think my ruby version is 2.5+, so don't need devkit and i have uninstalled it.
Anyone could help me?
Although they made the Ruby+DevKit an "optional" download for the RubyInstaller on Windows, if you plan to install gems, it is practically a necessity. A large percentage of the most popular gems are C extension that will need built on your machine when being installed.
The DevKit is a handy toolchain that supplies everything you need for this to be done, automatically without you needed to do anything more than type gem install XXXXX. Without it, you either cannot use C extension gems, or must have already installed MSYS and MingW, have them configured properly, which is all not a user-friendly experience, even for those who familiar with the process.
So even if DevKit is optional, it is still required to make the most of Ruby on Windows.
Solution re-install ruby with rubyinstaller-devkit-2.5.5-1-x64
and issue
gem install bundler
gem install jekyll
I got the same error message. It turned out that the culprit was the ffi gem. I got it to work using this solution.
I had the same issue. I was able to resolve it (in Windows 11 x64) via:
winget install -e --id RubyInstallerTeam.RubyWithDevKit
(I.e., reinstall Ruby with the DevKit)
I am trying to install gem json and getting error for json.
I'm running:
Windows 8.1 (64 bit)
Ruby: ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
gem: 1.8.2
D:\GIT\calabash>gem install json -v '1.8.3'
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.3 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
D:\GIT\calabash>
Its a late response, but may it helps someone else. to install json '1.8.3' it requires packages 'libgmp3-dev'.
Use following steps:
sudo apt-get install libgmp3-dev
gem install json -v '1.8.3'
For anyone who has this issue on Sierra, I solved the problem through this thread: https://teamtreehouse.com/community/installing-ruby-on-mac-got-error
Coles notes version is that after updating to most recent version of XCode, I had to accept the terms for the XCode command line tools. See them/agree to them by running:
gcc --version
After I did that, everything installed as expected.
To help you here are some steps to follow in order to install your gem locally:
Download json-1.8.3.
Place the downloaded gem into a folder called gems
Open the Ruby cmd console (click on start button, select Ruby then select "Start command prompt with Ruby")
cd to the gems folder. If the path to the folder is C:\Desktop\gems, write the command: cd C:\Desktop\gems then click "Enter".
To install the gem run the following command:
gem install --local json-1.8.3.gem
I tried it and it worked for me, hopefully it will work for you.
Result:
Second way:
Include the whole path of the gem in the command:
gem install --local C:\Users\kedarl\Desktop\T\json-1.8.2.gem
For me here is the result. (This time with the json-1.8.2.gem):
I've solved this by installing Command Line Tools Xcode of the version I have. I hope this helps someone else.
If you installed Rails through RailsInstaller, try this -
https://gist.github.com/luislavena/f064211759ee0f806c88
It's a pretty common bug for RailsInstaller currently.
I am trying to install jekyll on a 32 bit windows 7 PC . I downloaded ruby installer-32 bit and 32 bit devkit and extracted un ruby install folder.i got some ssh error which i resolved by temporarily switching to http instead of https and then updated gems as well as installed bundler using
gem install bundler
however gem install jekyll gives following error
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
C:/Ruby21/bin/ruby.exe -r ./siteconf20150109-5804-1k3wbva.rb extconf.rb
No such file or directory - C:/Ruby21/bin/ruby.exe -r ./siteconf20150109-5804-1k
3wbva.rb extconf.rb 2>&1
Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/fast-stemm
er-1.0.2 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/fas
t-stemmer-1.0.2/gem_make.out
You need to install the Ruby DevKit to fix the error you're seeing. Any sane Ruby install has the ability to build stuff on the fly.
I would start with Julian Thilo's awesome instructions for installing Jekyll on Windows:
Run Jekyll on Windows
If you are installing Ruby only for the purpose of running Jekyll, PortableJekyll will give you a full working Jekyll install in < 5 minutes.
Happy Jekylling...
I tried the same thing on 3 systems and found out that installing ruby gems fixed the issue .. so for anyone coming back at this question , this is how you install jekyll on a windows pc:
1.download and install ruby.
2.download devkit extract in to a folder(preferably inside ruby installation dir) and type in cmd window while in your devkit dir :
ruby dk.rb init
ruby dk.rb install
3.download and install gems by
ruby setup.rb
4. finally :
gem install bundler
gem install jekyll
*bundler is a jekyll dependency
I had the same issue on Windows 10 after installing Ruby+Devkit 2.5.X (x64) with the Windows installer.
The reason was that I changed the default path in the installer and had spaces in the path name. Apparently some make scripts do not like that.
Reinstalling to a path without any spaces fixed the issue.
Also see this related issue on github.
I failed to install "gem install jekyll bundler" when ruby was installed in "c:\program files\Ruby26-x64". After I reinstalled ruby on c:\Ruby26-x64 everything went ok. Seems like installation fails to parse path with blank
I've installed a instantrail2.0. I want to install watir 1.65
First I installed watir-1.6.5.gem it said 302 fetching http://gems.r....
then I downlord a rubygems-update-1.3.7.gem and type
gem install --local rubygems-update-1.3.7.gem
successfully installed.
then I type in update_rubygems
next I type in gem install watir-1.6.5.gem
but it appears ERROR:Failed to build gem native extension
I searched and found an answer that 1.3.7 doesn't support win32.
then I type
gem install sqlite3-ruby -v 1.3.0 gem install watir-1.6.5.gem
ERROR:Failed to build gem native extension
gem install sqlite3-ruby -v 1.2.3 gem install watir-1.6.5.gem
ERROR:Failed to build gem native extension
How can I do next??
use a more current version of Watir
I second Zeljko, going with the latest versions of rubygems and watir totally makes sense. If you must stick to older gems, try installing Ruby DevKit and then do the gem install to see if that helps.
What version of Ruby are you using? You should be using Ruby 1.8.6 with that version of Watir. I am also wondering if part of your problem is that you are doing a local install, instead of installing from internet. Local installs of Watir are difficult because of all of its dependencies.
I'm trying to install watir-webdriver by using gem install watir-webdriver on Linux. I have installed ruby 1.8.6, activesupport 2.3.8 as well as firewatir. However, when I try to install watir-webdriver, I get the following error:
Building native extensions. This could take a while...
ERROR: Error installing watir-webdriver:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
can't find header files for ruby.
(btw, for a bit of context - I'm a complete Linux newbie)
Assuming you installed ruby with yum, you'll need the rpm for development headers.
sudo yum install ruby-devel
and try again.