How to set path for Firefox Binary in Rails when using c9?

rails
ruby

#1

So I’m trying to use FireFox with Watir and the error I’m getting is "Could not find Firefox binary (os=linux). Make sure Firefox is installed or set the path manually with Selenium::WebDriver::Firefox::Binary.path="
When I check the file path for FireFox on my PC it’s This PC/Windows (C:)/Program Files/Mozilla FireFox

This is my code

    def save
        require 'watir'
        require 'firefox'

        @browser = Watir::Browser.new :firefox
        @browser.goto "https://kroger.softcoin.com/programs/kroger/digital_coupons/?origin=DigitalCoupons&banner=Smiths#contentBox"
    
        @browser.div(id: "contentBox").wait_until(&:present?).text
    
    # Could not find Firefox binary (os=linux). 
    # Make sure Firefox is installed or set the path manually with Selenium::WebDriver::Firefox::Binary.path=
    #ThisPC:WindowsC:ProgramFiles:MozillaFireFox
    
    @products = @browser.divs

end

#2

If you’re running a Selenium test on your workspace, you’ll need to make sure that Firefox is installed on the workspace itself in a headless instance that you can then point to. You can’t point this towards your PC as this would require a remote connection.

I’d recommend following Watir’s instructions here for setup: https://github.com/watir/watirbook/blob/master/manuscript/main/headless.md


#3

I took a look at the instructions, but I didn’t understand how to put Firefox on the path after reading it?