Forum: Ruby on Rails Rails 3 upgrade - Custom cache store

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C93e2e78b0f39811d1c17a0c5ae14e11?d=identicon&s=25 Shep (Guest)
on 2010-11-18 08:35
(Received via mailing list)
I had a custom cache store set up in Rails 2.3.  I'm in the process of
upgrading to rails 3, but have run into a snag.  Before I had all the
setting in my environment.rb.  It would basically load a yaml file
with my server settings, and set up the store via config.cache_store.
It seemed like the correct place for this in Rails 3 was as an
initializer.  So I did basically the same thing, except using
MyApp::Application.config.cache_store.  I don't get any errors, but
when the app loads, Rails.cache returns
#<ActiveSupport::Cache::FileStore.

Another interesting thing is that if I load it in application.rb, it
will return the custom cache_store.  Hower, this doesn't work well for
me because Its dependent on things like Rails.env and Rails.root which
aren't initialized yet.  Any help?
This topic is locked and can not be replied to.