slovensko-digital / uvobot

8 stars 7 forks source link

Fix selenium/webdriver/chrome version #28

Closed stage-rl closed 3 months ago

stage-rl commented 4 months ago

Problem so zavislostou na nejakom starom repe s Chromom. Napr. tuto riesili takisto, odstranit webdrivers gem a aktualizovat selenium

https://github.com/titusfortner/webdrivers/issues/247#issuecomment-1641879165

jsuchal commented 3 months ago

@celuchmarek hmm, zeby stacilo toto? Skusme merge/deploy ci to zacne nieco hlasit.

stage-rl commented 3 months ago

No, mohol som napisat, ze mi to neslo teda z vybuildovaneho dockera predtym, a otestoval som si to z dockera po uprave a islo. Tak verim, ze zaberie.

celuchmarek commented 3 months ago

Super, diky @stage-rl . Mergnem a uvidíme, čo sa stane 😄

celuchmarek commented 3 months ago

@stage-rl Takže ty si nedostal takýto error?

root@uvobot-869dd8db74-vrn9p:/app# bundle exec rake uvobot:run
rake aborted!
LoadError: cannot load such file -- selenium-webdriver
/app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require'
/app/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.8.1/lib/active_support/dependencies.rb:291:in `block in require'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.8.1/lib/active_support/dependencies.rb:257:in `load_dependency'
/app/vendor/bundle/ruby/2.7.0/gems/activesupport-5.2.8.1/lib/active_support/dependencies.rb:291:in `require'
/app/lib/uvobot/uvo_scraper.rb:3:in `<main>'
/app/lib/uvobot.rb:2:in `require_relative'
/app/lib/uvobot.rb:2:in `<main>'
/app/lib/tasks/uvobot.rake:5:in `require_relative'
/app/lib/tasks/uvobot.rake:5:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => uvobot:run
(See full trace by running task with --trace)

Po pridaní selenium-webdriver do Gemfile zase:

2024-03-26 15:16:54 WARN Selenium applicable driver not found; attempting to install with Selenium Manager
rake aborted!
Selenium::WebDriver::Error::WebDriverError: Unable to locate the chromedriver executable; for more information on how to install drivers, see https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/
/app/vendor/bundle/ruby/2.7.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/common/driver_finder.rb:36:in `path'
/app/vendor/bundle/ruby/2.7.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/common/local_driver.rb:49:in `process_options'
/app/vendor/bundle/ruby/2.7.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/common/local_driver.rb:27:in `initialize_local_driver'
/app/vendor/bundle/ruby/2.7.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/chrome/driver.rb:34:in `initialize'
/app/vendor/bundle/ruby/2.7.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/common/driver.rb:47:in `new'
/app/vendor/bundle/ruby/2.7.0/gems/selenium-webdriver-4.9.0/lib/selenium/webdriver/common/driver.rb:47:in `for'
/app/lib/uvobot/uvo_scraper.rb:22:in `initialize'
/app/lib/tasks/uvobot.rake:29:in `new'
/app/lib/tasks/uvobot.rake:29:in `block (2 levels) in <main>'
/app/vendor/bundle/ruby/2.7.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Tasks: TOP => uvobot:run
(See full trace by running task with --trace)
2024-03-26 15:16:56 WARN Selenium Unable obtain driver using Selenium Manager
 Unsuccessful command executed: ["/app/vendor/bundle/ruby/2.7.0/gems/selenium-webdriver-4.9.0/bin/linux/selenium-manager", "--browser", "chrome", "--output", "json"]
The chromedriver version cannot be discovered
stage-rl commented 3 months ago

U mna napr. dnes takto:

bundle exec rake uvobot:run Dnes som nenašiel žiadne nové IT zákazky.

A to mas z toho dockera?