Line 1524 ( function urlencode ) doesn't work anymore in ruby trunk.
Replacing it by 

str.gsub(/[^a-zA-Z0-9_\.\-]/n) { sprintf('%%%02x', $&.getbyte(0)) }

makes it work. maybe using URI.encode would work too?