Reputation: 4629
I'm trying to configure Rails 3 cache_store with something like this in environments/development.rb:
config.cache_store = :memory_store, {:size => 64.megabytes, :expires_in => 5.minutes}
But when i start server i get:
undefined method `megabytes' for 64:Fixnum (NoMethodError)
Probably something is not loaded yet.
My question is: where is the right place to configure it them? Where should i place this code?
Upvotes: 5
Views: 2636
Reputation: 316
Or else add this line
require 'active_support/core_ext/numeric/bytes'
before
config.cache_store = :memory_store, {:size => 64.megabytes, :expires_in => 5.minutes}
Upvotes: 16
Reputation: 5508
Use ActionController::Base.cache_store =
and place in an initializer file (create an rb file in config/initializers)
Upvotes: 1