teamcapybara/capybara · error · LoadError
Capybara's selenium driver is unable to load `selenium-webdr
Error message
Capybara's selenium driver is unable to load `selenium-webdriver`, please install the gem and add `gem 'selenium-webdriver'` to your Gemfile if you are using bundler.
What it means
Error "Capybara's selenium driver is unable to load `selenium-webdriver`, please install the gem and add `gem 'selenium-webdriver'` to your Gemfile if you are using bundler." thrown in teamcapybara/capybara.
Source
Thrown at lib/capybara/selenium/driver.rb:52
# Selenium::WebDriver::VERSION. Ideally we'd
# use the constant in all cases, but earlier versions
# of `selenium-webdriver` didn't provide the constant.
@selenium_webdriver_version =
if Gem.loaded_specs['selenium-webdriver']
Gem.loaded_specs['selenium-webdriver'].version
else
Gem::Version.new(Selenium::WebDriver::VERSION)
end
unless Gem::Requirement.new('>= 4.8').satisfied_by? @selenium_webdriver_version
warn "Warning: You're using an unsupported version of selenium-webdriver, please upgrade to 4.8+."
end
@selenium_webdriver_version
rescue LoadError => e
raise e unless e.message.include?('selenium-webdriver')
raise LoadError, "Capybara's selenium driver is unable to load `selenium-webdriver`, please install the gem and add `gem 'selenium-webdriver'` to your Gemfile if you are using bundler."
end
attr_reader :specializations
def register_specialization(browser_name, specialization)
@specializations ||= {}
@specializations[browser_name] = specialization
end
end
def browser
unless @browser
options[:http_client] ||= begin
require 'capybara/selenium/patches/persistent_client'
if options[:timeout]
::Capybara::Selenium::PersistentClient.new(read_timeout: options[:timeout])
else
::Capybara::Selenium::PersistentClient.newView on GitHub (pinned to 15b5fdb76e)
When it happens
Trigger: Thrown at lib/capybara/selenium/driver.rb:52 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of teamcapybara/capybara@15b5fdb76e (2026-08-21).
Data as JSON: /api/errors/b37e5e7cedccd727.
Report an issue: GitHub.