delano / redis-dump

Redis to JSON and nack again
https://rubygems.org/gems/redis-dump
MIT License
818 stars 123 forks source link

undefined method `select!` for ["x"]:Array #5

Closed xiefei closed 12 years ago

xiefei commented 12 years ago

this bug code file:redis/dump.rb dum method chunk_entries = [] chunk_entries.select! do | key |

jovikao commented 12 years ago

I have the similar problem. ERROR (NoMethodError): undefined method select!' for #<Array:0x1010d2990> /Users/jovikao/.gem/ruby/1.8/gems/redis-dump-0.3.2/lib/redis/dump.rb:74:indump' /Users/jovikao/.gem/ruby/1.8/gems/redis-dump-0.3.2/lib/redis/dump.rb:102:in process_chunk' /Users/jovikao/.gem/ruby/1.8/gems/redis-dump-0.3.2/lib/redis/dump.rb:71:indump'

xiefei commented 12 years ago

yes , change chunk_entries = [] chunk_entries.select! do | key |

coliver commented 12 years ago

@jovikao This issue is happening because you are using ruby 1.8.

chatreek commented 12 years ago

@coliver I have a same problem like @jovikao and i try to upgrade version of ruby from 1.8.7 to 1.9.3. but It's still not working.

ERROR (NoMethodError): undefined method `select!' for #Array:0x2b87670e4a38

how should I do ?

coliver commented 12 years ago

@chatreek: It won't work on 1.8.7 because select! is not defined for Array. If you are using 1.9.3, you should not be getting that error.

HessianZ commented 12 years ago

How can I fix this issue?

Add this line?

"chunk_entries = []"

zhaoyou commented 12 years ago

@delano is it fix this bug ?

delano commented 12 years ago

I no longer work with Ruby 1.8.x but I'm happy to pull in a patch request (tests go in try/10_redis_dump_try.rb).