Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on Ruby 1.9.3 #1

Open
nd2s opened this issue Apr 22, 2012 · 7 comments
Open

Exception on Ruby 1.9.3 #1

nd2s opened this issue Apr 22, 2012 · 7 comments

Comments

@nd2s
Copy link

nd2s commented Apr 22, 2012

On Ruby 1.9.3 got following exception:
NoMethodError (undefined method `value' for #String:0x00000004326848)

I don't know why exactly but this seems to fix it (I guess it will break it for Ruby 1.8):
nd2s@dd0b5ee

@pierrevalade
Copy link

Got the same error.

@jjb
Copy link

jjb commented Jul 31, 2012

I'm getting this too, and @MQT's change fixes it for me

@ghost
Copy link

ghost commented Oct 12, 2012

I too have same error with ruby 1.9.2

@aehven
Copy link

aehven commented Dec 21, 2012

I get a similar error with ruby 1.9.2:

undefined method `value' for "---\n- views/my_key\n":String

and it goes away when I clear the cache. Can someone explain how I get @MQT's fix? Do I have to pull the gem from somewhere else or download the code into the vendors dir and change it there?

@nd2s
Copy link
Author

nd2s commented Dec 22, 2012

You have to use the gem from my repo. But the fix is old and I don't really know what I did there. Wouldn't use that code on a production system..

I switched from memcached to redis then, which supports listing of keys and works much nicer. (I got some other issues with memcached and keys not being invalidated).

@aehven
Copy link

aehven commented Dec 22, 2012

Oh. Thanks for the advice, I'll look into Redis.

Thanks,

  • Adam

On Dec 21, 2012, at 5:15 PM, mqt [email protected] wrote:

You have to use the gem from my repo. But the fix is old and I don't really know what I did there. Wouldn't use that code on a production system..

I switched from memcached to redis then, which supports listing of keys and works much nicer. (I got some other issues with memcached and keys not being invalidated).


Reply to this email directly or view it on GitHub.

@aehven
Copy link

aehven commented Dec 24, 2012

Thanks again, @MQT, for the advice. I'm using Redis now and it seems to work.

For anyone else running into this, the use of Redis needs to be tweaked when using it as the cache_store. First of all, you must load the 'redis-rails' gem as well as the 'redis' gem. Then you must deal with the fact that Redis matches keys by a simplified wildcard notation rather than ruby Regexp. I found the details here:

http://dev.mensfeld.pl/2012/06/rails-3-2-redis-store-views-caching-and-expire_fragment-with-regexp/

But in my case I preferred to just fix my sweeper so that it uses redis wild-cards instead of adding the code shown in the link above to convert Regexp to redis wild-card keys. So all I did was fix the fragment string designations in my sweeper to use wildcards and add this to my redis.rb initializer to force redis to delete all matching keys when given a string:

module ActiveSupport
  module Cache
    class RedisStore < Store
      def delete(key, options)
        delete_matched(key, options)
      end
    end
  end
end

PanfilovDenis added a commit to PanfilovDenis/dalli-store-extensions that referenced this issue Apr 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants