ERROR: when executing gem ... (NoMethodError) undefined `spec 'method for nil: NilClass

I am trying to get started with ruby ​​and Watir-webdriver for some testing automation.

sudo apt-get install ruby rubygems

sudo gem install watir-webdriver

Whenever I install gem, I get the following errors:

[/usr/lib/ruby/gems/1.8/specifications/selenium-webdriver-2.13.0.gemspec] isn't a Gem::Specification (NilClass instead).
ERROR:  While executing gem ... (NoMethodError)
    undefined method `spec' for nil:NilClass
+5
source share
2 answers

The problem was that the root boot was stored in the cache, so that even after gem uninstallreinstalling the error persisted. To force a reboot, I emptied the cache directories that were found by checking under GEM PATHS at the output of the command gem env.

+4
source

You should try using Ruby 1.9.x

- RVM:

sudo apt-get install git
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
rvm install 1.9.2
rvm use 1.9.2
gem install watir-webdriver
+2

All Articles