Fix Ruby sample code so it works on Sauce Labs

Fix #2601
Fix #1458