Ruby on rails Rails低级缓存在开发模式下不工作

Ruby on rails Rails低级缓存在开发模式下不工作,ruby-on-rails,caching,Ruby On Rails,Caching,我对development.rb文件进行了如下配置: # Enable/disable caching. By default caching is disabled. config.action_controller.perform_caching = true config.cache_store = :memory_store config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=17

我对development.rb文件进行了如下配置:

# Enable/disable caching. By default caching is disabled.
config.action_controller.perform_caching = true

config.cache_store = :memory_store
config.public_file_server.headers = {
  'Cache-Control' => 'public, max-age=172800'
}
(删除了检查仅用于测试的文件的默认配置)

然后我打开一个
rails控制台来测试这一点,但它似乎不起作用:

[1] pry(main)> Rails.cache.write("asd", "asd")
=> true
[2] pry(main)> Rails.cache.read("asd")
=> nil
几天前我设法让它工作了,但现在它不工作了


A我遗漏了什么?

我通过重新启动spring修复了它。做

> spring stop
Spring stopped.
> spring start
这就是诀窍


注意:当再次启动spring时,它可能会失败,但无论如何它都会工作。

database.rb
?,您不是在谈论您的
config/environments/development.rb
文件吗?是的,对不起,输入错误。我会更新它。你在使用rails 5吗?它是一个新的应用程序吗?如果是的话,你是否在你的
config/environments/development.rb
文件中有这一行
if rails.root.join('tmp/caching-dev.txt').exist?
?我已经删除了这一行。我留下了development.rb文件,正如我在帖子中所说的。它是rails 5.1.6