unable to connect to chromedriver
I had the exact same issue. What worked for me was using the "webdrivers" gem. Part of my gemfile looks like this:
group :development, :test do gem 'rspec-rails' gem 'capybara' gem 'webdrivers'end
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 updateapt-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.zipunzip chromedriver_linux64.zipcp chromedriver /usr/local/binchmod +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.newheadless.startbrowser = Watir::Browser.new :chromebrowser.goto 'http://google.com'...browser.closeheadless.destroy
Good luck!
Running on Ubuntu 12.10, I also had the error message:
unable to connect to chromedriver http://127.0.0.1:9515
Wasn't working even after I downloaded it and installed it correctly. I even tried using the chromedriver-helper gem. So I ran chromedriver manually (/usr/bin/chromedriver) and found out 2 things:
1) I had a missing package dependency on libnss3 which was fixed using sudo apt-get install libnss3
2) Version 2.9 of chromedriver (latest as of Feb 2014) requires chrome > version 31, and I had v25, which was fixed using sudo apt-get --only-upgrade install google-chrome-stable