Скрипт работает локально, но не на сервере.
b = Watir::Browser.new :chrome, headless: true
Ошибка:
response.rb:69:in `assert_ok': unknown error: Chrome failed to start: exited abnormally (Selenium::WebDriver::Error::UnknownError)
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
(Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.9.75-29.el7.x86_64 x86_64)
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/response.rb:32:in `initialize'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/common.rb:84:in `new'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/common.rb:84:in `create_response'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/default.rb:104:in `request'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/http/common.rb:62:in `call'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/bridge.rb:166:in `execute'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/bridge.rb:99:in `create_session'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/bridge.rb:53:in `handshake'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/chrome/driver.rb:49:in `initialize'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/common/driver.rb:44:in `new'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/common/driver.rb:44:in `for'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver.rb:86:in `for'
from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/watir-6.16.5/lib/watir/browser.rb:46:in `initialize'
from rebooter.rb:9:in `new'
from rebooter.rb:9:in `<main>'
Я нашел несколько ответов, в которых упоминается --disable-dev-shm-usage
, но я не знаю, как его пройти.
Я безуспешно пытался:
Watir::Browser.new :chrome, headless: true, disableDevShmUsage: true
Я не совсем уверен, что такое shm, но df показывает, что я использую его на 0%:
# df -h | grep -Ei 'shm|use%'
Filesystem Size Used Avail Use% Mounted on
tmpfs 962M 0 962M 0% /dev/shm
Как изменить скрипт для запуска также на сервере? Почему он работает локально, а не на сервере?