我正在创建一个新的 Rails 3.2 项目,除了我对 css 文件所做的最后修改之外,一切都加载正常。
如果我 app/assets/stylesheets/application.css
更改此文件中的任何内容,则在控制台运行以下命令之前,我无法在浏览器上看到更改:
捆绑 exec rake Assets :预编译 RAILS_ENV=development
我的config/environment/development.rb
文件。
Sample::Application.configure do
# 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
end
有什么帮助吗?
最佳答案
问题是我已经编译了 Assets ,因此 Rails 正在提供这些文件的已编译版本。
在这种情况下,您所要做的就是删除已经生成的文件,例如 application.css
和 application.css.gz
就可以了又开始工作了。
希望它对某人有帮助。
关于ruby-on-rails - Rails 3.2 和 css 文件的修改直到 Assets :precompile 才反射(reflect),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9242936/