undefined method `tr' for nil:NilClass
netcurate opened this issue · comments
We are getting the below error every now and then .. unescape method has the "tr" variable.
Exception details => --- !ruby/exception:NoMethodError message: undefined method `tr' for nil:NilClass
Exception backtrace => ["/app/vendor/bundle/ruby/1.9.1/gems/postrank-uri-1.0.17/lib/postrank-uri.rb:133:in unescape'", "/app/vendor/bundle/ruby/1.9.1/gems/postrank-uri-1.0.17/lib/postrank-uri.rb:139:in
clean'"
Regards
Can you provide an example URL triggering this?
Here are some of them
http://t.co/WjH8itrAGN
http://t.co/oudZhlIwXE
http://t.co/vRatIW2poI
Those urls work fine here.
it "should extra t.co links" do
e('http://t.co/WjH8itrAGN http://t.co/oudZhlIwXE').should include(
'http://t.co/WjH8itrAGN', 'http://t.co/oudZhlIwXE'
)
end
Spec passes without any failures.
My bad. I shouldn't have sent those links as we expand those links before using the clean API. Also, I do not call multiple links at the same time. It's one link at a time.
In addition, we have created our own set of
PostRank::URI::C18N[:global]
PostRank::URI::C18N[:hosts]
So, the link which failed is below :
It's kind of difficult to understand why this may fail, because we are certainly processing a lot of links and they seem to be working fine.
The link you provided also comes out fine here (sans utm parameters). I suspect it has something to do with your C18N files...