问题
Why would watir only fail on a heroku worker node?
I'm trying to go to run a basic function of going to google.com. This works fine when I run it on a web dyno but fails when I use delayed job to run it on a worker.
The code is as follows
Selenium::WebDriver::Chrome.path = "/app/.apt/usr/bin/google-chrome"
Selenium::WebDriver::Chrome.driver_path = "/app/vendor/bundle/bin/chromedriver"
browser = Watir::Browser.new :chrome
browser.goto "google.com"
I then receive the following error:
Failed to open TCP connection to 127.0.0.1:9515 (Connection refused - connect(2) for "127.0.0.1" port 9515)
I'm using the heroku google chrome, and chromedriver buildpacks and my gemfile is
gem 'watir'
gem 'chromedriver-helper'
gem 'delayed_job_active_record'
I've used heroku ps:exec --dyno=worker.1
and run rails c
and am able to run the same exact code and not receive the error which makes me belive that it's not an installation error. Why would this fail only on a worker node? And I'm also confused why it would work on a worker node with rails c
.
来源:https://stackoverflow.com/questions/52188535/selenium-watir-tcp-connection-fails-only-on-worker-dyno-heroku