0
votes

ruby ubuntu rubygems wati automation testing tool watir in the newest version of Ubuntu.

I did a sudo apt-get install ruby to get the latest version of ruby, then I installed Rubygems and tried installing watir, but i'm getting this error. It's using Ruby 1.8.7

I've also tried removing ruby and ruby gems and reinstalling but the error message still happens.

Can anyone tell me whats wrong?

root@kelley-VirtualBox:/home/kelley# gem -v
bash: /usr/bin/gem: No such file or directory
root@kelley-VirtualBox:/home/kelley# sudo apt-get install rubygems
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libtcltk-ruby1.8
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  rubygems
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/425 kB of archives.
After this operation, 4,166 kB of additional disk space will be used.
Selecting previously deselected package rubygems.
(Reading database ... 157806 files and directories currently installed.)
Unpacking rubygems (from .../rubygems_1.7.2-1_all.deb) ...
Processing triggers for man-db ...
Setting up rubygems (1.7.2-1) ...
root@kelley-VirtualBox:/home/kelley# gem list

*** LOCAL GEMS ***


root@kelley-VirtualBox:/home/kelley# gem install watir
Building native extensions.  This could take a while...
ERROR:  Error installing watir:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.8 extconf.rb
checking for strncpy_s()... no
creating Makefile

make
gcc -I. -I. -I/usr/lib/ruby/1.8/i686-linux -I. -D_FILE_OFFSET_BITS=64  -fPIC -fno-strict-aliasing -g -g -O2  -fPIC   -c win32/api.c
win32/api.c:2:21: fatal error: windows.h: No such file or directory
compilation terminated.
make: *** [api.o] Error 1


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/win32-api-1.4.8 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/win32-api-1.4.8/ext/gem_make.out
root@kelley-VirtualBox:/home/kelley# 
1

1 Answers

4
votes

Look at the Ubuntu documentation. There's a comprehensive, step-by-step guide that you can follow.

It seems like waitr is Windows-only. Try sudo gem install watir-webdriver