Marco L.
Marco L.

Reputation: 1499

watir on ubuntu 11.10

I've just updated my system from ubuntu 11.04 to 11.10 and...surprise! Now if I try to use watir, doing

require 'rubygems'
require 'watir-webdriver'

I obtain this error

require 'watir-webdriver'
Invalid gemspec in [/var/lib/gems/1.8/specifications/json_pure-1.6.1.gemspec]: 
      invalid date format in specification: "2011-09-18 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/watir-webdriver-0.3.5.gemspec]: 
      invalid date format in specification: "2011-10-05 00:00:00.000000000Z"

LoadError: no such file to load -- watir-webdriver
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (irb):3
from /usr/lib/ruby/1.8/x86_64-linux/rbconfig.rb:22

How to make it work again?

Upvotes: 3

Views: 2045

Answers (4)

Gabe Spradlin
Gabe Spradlin

Reputation: 2057

I've seen this issue with the json gem (and now that I've upgraded to 11.10 other gems). The fix I'd previously seen for the json gem was to go into the gem file and listed in the error and remove the "00:00:00.000000000Z" string wherever you found it.

I've used it on every gem I've received this error on (which was only a couple but I don't remember which exactly). The the gems seem to work just fine. I haven't noticed any problems since removing that string.

Upvotes: 0

Jan
Jan

Reputation: 1

I have had the same problem and could fix it by adjusting the jason spec file: /var/lib/gems/1.8/specifications/json_pure-1.6.1.gemspec

In the date format line I removed everything which looked like this "00:00:00.000000000Z" and kept just the plain date format.

After again installing watir (see watir installation web page) everything worked properly:

sudo apt-get install rubygems gem install watir --no-rdoc --no-ri

Upvotes: 0

Alister Scott
Alister Scott

Reputation: 3685

Your version of ruby has problems. Install RVM, and get it to install a fresh ruby:

 1. bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
 2. echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
 3. source .bash_profile 
 4. rvm install 1.9.2
 5. rvm use 1.9.2

Upvotes: 1

Željko Filipin
Željko Filipin

Reputation: 57312

All I know about running Watir on Linux is here:

https://github.com/zeljkofilipin/watirbook/blob/master/installation/ubuntu.md

Did you check if Ubuntu update broke your Ruby installation? Maybe it uninstalled watir-webdriver gem or something.

What do you get for gem list watir?

Upvotes: 1

Related Questions