On Mac OS
It works fine with watir-webdriver and Safari
browser = Watir::Browser.new :safari
If you'd like to use Chrome, make sure that it is installed, plus you need to install mac os developer tools with
xcode-select --install
and also install chromedriver with brew
brew install chromedriver
On Linux
I had the same error on my staging Ubuntu 12.04 server and the problem was I didn't install chrome itself like this (with superuser permissions):
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
apt-get update
apt-get install google-chrome-stable
Install chromedriver(use proper path for your system and version):
wget http://chromedriver.storage.googleapis.com/2.7/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
cp chromedriver /usr/local/bin
chmod +x /usr/local/bin/chromedriver
After that I would recommend you to use watir-webdriver in headless mode
require 'watir-webdriver'
require 'headless'
headless = Headless.new
headless.start
browser = Watir::Browser.new :chrome
browser.goto 'http://google.com'
...
browser.close
headless.destroy
Good luck!