elcuervo / minuteman

Fast analytics using Redis
elcuervo.github.com/minuteman
MIT License
629 stars 63 forks source link

Undefined method 'bitcount' for nil:NilClass when calling length method #12

Closed mbrichman closed 10 years ago

mbrichman commented 10 years ago

I have been using Minuteman for a while now successfully. However, something has changed in my environment such that I'm now getting the error above when trying to use the length method on a minuteman object.

Even using the examples on the readme page to do not work.

analytics.track("login:successful", 1)
today_events = analytics.day("login:successful", Time.now.utc)
today_events.length -> throws the error above.

I'm using Redis 2.6.12 with Ruby 2.0-p247

Any ideas?

Thanks!

elcuervo commented 10 years ago

Mmmm, can you clone the project and try the tests? The only possible scenario I can think of is that you are using master and you are passing an empty options[:redis]

Which version are you using?

mbrichman commented 10 years ago

To close the loop on this, the issue was caused due to updating of some other gems. I didn't bother to narrow down which one it was, but backing out my changes resolved the problem.

levent commented 9 years ago

I'm getting this on all lookups. I've tried this with Ruby 2.0.0 and 2.2.2

@mbrichman do you remember what resolved this for you?

To me it seems like the ruby delegators for safe and redis aren't doing what they are meant to in bit_operations.rb

analytics.day("login:successful", Time.now.utc).include?(1)
# NoMethodError: undefined method `getbit' for nil:NilClass

analytics.day("login:successful", Time.now.utc).length
# NoMethodError: undefined method `bitcount' for nil:NilClass
mbrichman commented 9 years ago

@levent As I said above, I believe it to be a gem conflict with some unspecified gem.

I've subsequently implemented this gem in other projects without seeing this issue again.