jnbt / candy_check

Check and verify in-app receipts
MIT License
125 stars 70 forks source link

NoMethodError: undefined method `URI' for #<CandyCheck::AppStore::Client:0x007f4f0f6326c0> #3

Closed Niklas9 closed 8 years ago

Niklas9 commented 8 years ago

While trying to validate a certain receipt with shared secret, I get this error:

irb(main):023:0* verifier.verify(data, key)
NoMethodError: undefined method 'URI' for #<CandyCheck::AppStore::Client:0x007f4f0f6326c0>
    from /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/candy_check-0.0.3/lib/candy_check/app_store/client.rb:14:in 'initialize'
    from /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/candy_check-0.0.3/lib/candy_check/app_store/verification.rb:44:in 'new'
    from /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/candy_check-0.0.3/lib/candy_check/app_store/verification.rb:44:in 'verify!'
    from /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/candy_check-0.0.3/lib/candy_check/app_store/verification.rb:29:in 'call!'
    from /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/candy_check-0.0.3/lib/candy_check/app_store/verifier.rb:44:in 'call_for'
    from /home/vagrant/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/candy_check-0.0.3/lib/candy_check/app_store/verifier.rb:34:in 'verify'
    from (irb):23
    from /home/vagrant/.rbenv/versions/2.2.2/bin/irb:11:in '<main>'

Was just following the documentation in the README.md for AppStore to get this.

jnbt commented 8 years ago

Hi @Niklas9,

this surely is a bug. Thanks for noticing me. I think we never used this gem in isolation, so in other environments "net/http" was already loaded.

if fixed this problem in 1cee24e and published version 0.0.5 . Maybe you want to give it another try.

Niklas9 commented 8 years ago

Ha, works! Thanks for the short response time

jnbt commented 8 years ago

If you find further problems don't hesitate to ask.