新手问题 Why Rails 4 remove assets group?

xiaoronglv · January 29, 2014 · Last by xiaoronglv replied at January 29, 2014 · 2367 hits

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 不是这样吗。

You need to Sign in before reply, if you don't have an account, please Sign up first.