want to get original url from short(i.e tiny,bit.ly etc) url

Hi all,

   I am using Expurrel gem to get the original url from the short url
for all the url shortener services.It works good on the script/console
and irb but it is throughing me error like "URI::InvalidURIError in
KeywordsController#create" in my application after giving some no. of
original url and its for "bit.ly" url shortener. So is there any
solution for this or any other gem or plugin is available to get
original url from the short url? Can any one please help me??

Thanks
Preksha