【发布时间】:2013-12-05 00:29:20
【问题描述】:
我正在使用 Rails 3.1,并且已经开发了一年半。今天早上我一定做了什么,现在我的很多文件似乎都被缓存了。这包括视图文件、控制器和模型。
我可以对模型、控制器等进行更改,并且不会对我的应用程序产生任何影响(在 localhost:3000 上运行)。我曾尝试切换端口(例如切换到 localhost:3005),但没有成功。
我没有更改任何配置文件或在我的计算机(Mac、Lion)上进行任何大的更改,但显然我一定做了什么。
- 我在开发模式下工作
- 我在 Mac 上使用 TextMate
- 公用文件夹为空,404 页等除外
- 我已删除 /caches/assets 文件夹
- 我已删除浏览器上的缓存
重新启动服务器使其始终正常工作!有时(尽管很少)更改无需重新启动即可生效。
这是我的 development.rb:
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Raise exception on mass assignment protection for Active Record models
config.active_record.mass_assignment_sanitizer = :strict
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
可能发生了什么,我该如何解决或排除故障?
【问题讨论】:
-
设置“config.cache_classes = true”然后再改回false似乎暂时解决了问题...可能是一个线索?
-
您是否设法解决了这个问题,我们发生了完全相同的事情,它似乎是特定于计算机的。在我的电脑上它可以在我同事的电脑上运行,它会不断缓存类。
标签: ruby-on-rails caching