Getting Chromedriver to work with Capybara and Selenium

Abu Eesa
Abu Eesa
Apr 5, 2016 · 1 min read

If you are trying to run Capybara/Selenium on Chrome using Chromedriver but getting errors such as:

undefined local variable or method `“chromedriver”' for main:Object (NameError)

Then do the following:

1. Download the latest Chromedriver from here:

2. If on Mac OS X, after downloading Chromedriver, put it in the proper PATH. Typically it will be stored in ‘/usr/bin’

3. If on Windows, after downloading Chromedriver, put it where ever you want. But add it to the path by going to ‘Control Panel’ > ‘System’ > ‘Advanced System Settings’ > ‘Environment Variables’ > Edit the Path variable to include it (C:\RailsInstaller) for me. Then restart Windows for the new path to take affect.

Tags: capybara, Chrome, Chromedriver, Selenium, Selenium Webdriver


QA Automation & Testing + DevOps