2012-04-17 1 views
5

내가 레일즈 환경에서이 같은 3 cache_store를 구성하기 위해 노력하고있어/development.rb :Rails 3 cache_store를 어디에서 구성 할 것인가?

config.cache_store = :memory_store, {:size => 64.megabytes, :expires_in => 5.minutes} 

하지만 서버를 시작할 때 내가 얻을 : 아마 뭔가가 아직로드되지

undefined method `megabytes' for 64:Fixnum (NoMethodError) 

을 .

내 질문은 : 어디서 구성 할 수 있습니까? 이 코드는 어디에 두어야합니까? 이니셜 라이저 파일에

답변

1

사용 ActionController::Base.cache_store = 장소 (설정에 RB 파일을 생성/초기화)

15

아니면 추가이 줄

require 'active_support/core_ext/numeric/bytes' 

config.cache_store = :memory_store, {:size => 64.megabytes, :expires_in => 5.minutes} 
관련 문제