avinashbot / redd

Redd is a batteries-included API wrapper for reddit.
MIT License
186 stars 75 forks source link

Getting NoMethodError (undefined method `new' for nil:NilClass) #96

Open kglns opened 4 years ago

kglns commented 4 years ago

Hello,

I am getting below error when I call Redd.it

I tried 2 versions, both of which produced the same issue.

Versions 0.8.8 0.7.10

>> reddit = Redd.it(
user_agent: 'xxxx',
         client_id: 'xxxx',
         secret: 'xxx',
         username: 'xxx',
         password: 'xxx'
>>  )
Traceback (most recent call last):
        2: from (irb):4
        1: from (irb):4:in `rescue in irb_binding'
NoMethodError (undefined method `new' for nil:NilClass)
drice89 commented 4 years ago

Im getting the same thing

edit: My problem was that I was using 0.7.10 and that has a different .it method.

When I tried to update to 0.8.8 I had a conflict with the gem spec for HTTP. I forked the repo and modified the gem spec so the the http version was >= 3.0 and I stopped having the problem. I am not sure this repo is being supported anymore so you may be better off just forking the repo and trying some things out to see if it solves your problem.