The easiest and most elegant way to handle basic browser authentication is to supply the username and password in the URL, bypassing the dialog altogether.
require 'watir-webdriver' b = Watir::Browser.start 'http://admin:email@example.com'
If the above method doesn’t work, eg. you are authenticating against a NTLM proxy, you may have find using the AutoAuth Firefox extension will enable you to automatically dismiss this dialog with your credentials. See this blog post for full details.
Example Basic Browser Authentication Dialog