postrank-labs / postrank-uri

URI normalization, c14n, escaping, and extraction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:inclean'"


Regards

Can you provide an example URL triggering this?

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 :

http://www.businessinsurance.com/article/20131006/NEWS04/310069943?utm_source=twitterfeed&utm_medium=twitter

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...