>>Before you apply "gsub!", test the class:
>>
>>
>>>  res = dbh.query("Select url FROM sites")
>>>  while url = res.fetch_row do
>>
>>puts url.class  # Add this. Read the result. Then decide what to do.
> 
> Brilliant.  Here's the output:
> Array
> ...
> Array

All right. Now change "puts url.class" to "p url" to figure out what you 
should do with those Arrays.

Devin