新手问题 Why Rails 4 remove assets group?

xiaoronglv · 2014年01月29日 · 最后由 xiaoronglv 回复于 2014年01月29日 · 2371 次阅读

Rails 4.0 removed the assets group from Gemfile. You'd need to remove that line from your Gemfile when upgrading. You should also update your application file (in config/application.rb):

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)

我在 stackoverflow 上找到了答案,但是还是不太理解。

Stackoverflow

Previously the assets group existed to avoid unintended compilation-on-demand in production. As Rails 4 doesn't behave like that anymore, it made sense to remove the asset group.

Previously the assets group existed to avoid unintended compilation-on-demand in production

这一句是什么意思?

Rails 4 是强制precompile your assets, 莫非 Rails 3 不是这样吗。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号