On WSLv1 when you set the "executable_path" to a windows browser the websocket url has a carriage return in it and it breaks the code.
/usr/lib/ruby/3.0.0/uri/rfc3986_parser.rb:67:insplit': bad URI(is not URI?): "ws://127.0.0.1:59359/devtools/browser/7be24a1d-1c2e-4839-a3a9-2516e01e1d20\r" (URI::InvalidURIError)
from /usr/lib/ruby/3.0.0/uri/rfc3986_parser.rb:72:in parse' from /usr/lib/ruby/3.0.0/uri/common.rb:171:inparse'
from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket.rb:24:in initialize' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket.rb:60:innew'
from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket.rb:60:in initialize' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket_transport.rb:5:innew'
from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket_transport.rb:5:in create' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/browser_runner.rb:167:insetup_connection'
from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/launcher/chrome.rb:76:in launch' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/puppeteer.rb:78:inlaunch'
from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer.rb:86:in public_send' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer.rb:86:inblock (3 levels) in '
from get-pin.rb:5:in get_browser' from get-pin.rb:34:in'`
On WSLv1 when you set the "executable_path" to a windows browser the websocket url has a carriage return in it and it breaks the code.
/usr/lib/ruby/3.0.0/uri/rfc3986_parser.rb:67:in
split': bad URI(is not URI?): "ws://127.0.0.1:59359/devtools/browser/7be24a1d-1c2e-4839-a3a9-2516e01e1d20\r" (URI::InvalidURIError) from /usr/lib/ruby/3.0.0/uri/rfc3986_parser.rb:72:inparse' from /usr/lib/ruby/3.0.0/uri/common.rb:171:in
parse' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket.rb:24:ininitialize' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket.rb:60:in
new' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket.rb:60:ininitialize' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket_transport.rb:5:in
new' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/web_socket_transport.rb:5:increate' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/browser_runner.rb:167:in
setup_connection' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/launcher/chrome.rb:76:inlaunch' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer/puppeteer.rb:78:in
launch' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer.rb:86:inpublic_send' from /var/lib/gems/3.0.0/gems/puppeteer-ruby-0.45.3/lib/puppeteer.rb:86:in
block (3 levels) inget_browser' from get-pin.rb:34:in
my change fixes that