Unable to load application: Selenium::WebDriver::Error::WebDriverError: not a file: "/usr/local/bin/chromedriver
CrazybutSolid opened this issue · 4 comments
Hey guys,
Seems that my app can find chrome but not the chrome driver.
How do I let Capybara know where to get it?
Running with Heroku on Rails
Having the same issue
I had to intall two buildpacks
https://github.com/heroku/heroku-buildpack-google-chrome
https://github.com/heroku/heroku-buildpack-chromedriver
and this is how I call the driver. It works now. Hope it helps.
def self.driver_setup
chrome_bin = ENV.fetch('GOOGLE_CHROME_SHIM', nil)
# chrome_opts = chrome_bin ? { "chromeOptions" => { "binary" => chrome_bin } } : { args: %w[headless disable-gpu] }
chrome_opts = chrome_bin ? { "chromeOptions" => { "binary" => chrome_bin } } : { args: %w[headless disable-gpu no-sandbox] }
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome(chrome_opts),
)
end
Capybara.javascript_driver = :chrome
session = Capybara::Session.new(:chrome)
end
Also, using gems:
gem 'chromedriver-helper'
gem "selenium-webdriver"
the webdrivers gem doesn't work for me
Closing stale issues. If the issue persists with the latest version of the buildpack please open a new issue with a minimal reproducable example (but also bear in mind that this buildpack is not an officially supported buildpack, so unless there is an actual bug with the buildpack, application debugging issues are generally out of scope).