gpt4 book ai didi

ruby-on-rails-3 - 在哪里配置 Rails 3 cache_store?

转载 作者:行者123 更新时间:2023-12-03 00:43:23 25 4
gpt4 key购买 nike

我正在尝试在environments/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)

可能有些东西还没有加载。

我的问题是:配置它们的正确位置在哪里?我应该把这段代码放在哪里?

最佳答案

或者添加此行

require 'active_support/core_ext/numeric/bytes'

之前

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

关于ruby-on-rails-3 - 在哪里配置 Rails 3 cache_store?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10200339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com