Matrix
Matrix

Reputation: 3369

watir with ruby 3 and rails 6 : wrong number of arguments

I update my app to ruby 3 from ruby 2 and update gem (with Rails 6+) :

gem 'headless'
gem 'watir'
gem 'webdrivers'
gem 'watir-scroll'
gem 'webdriver-user-agent'

(bonus question : I don't know if "watir-rails" is needed ? https://github.com/watir/watir-rails )

but now if I just try make a firefox browser :

Watir::Browser.new :firefox

I have an error :

/home/USER/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/selenium-webdriver-3.142.7/lib/selenium/webdriver/firefox/driver.rb:31:in `new': wrong number of arguments (given 1, expected 0) (ArgumentError)

It's maybe about hash argument change between ruby 2 and 3 ? so how use watir with ruby 3?

Upvotes: 0

Views: 391

Answers (1)

titusfortner
titusfortner

Reputation: 4194

Selenium 3 doesn't work with ruby 3. Upgrade to latest 4.0 release candidate of Selenium, and the latest 7.0 beta version of watir.

Upvotes: 2

Related Questions