Installing Mongrel on Ubuntu ERROR: While executing gem ... (OpenURI::HTTPError)

If you get the following error:

ERROR: While executing gem ... (OpenURI::HTTPError) 404 Not Found

when running the following:

sudo gem install mongrel

Then run it again. Sometimes it takes running the command several times for it to take.