未验证 提交 802f374a 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #34261 from matildasmeds/guides_remove_upgrade_section_from_asset_pipeline_guide

Remove "Upgrading from Old Versions" from Asset Pipeline Guide [skip ci]
......@@ -1234,60 +1234,3 @@ it as a preprocessor for your mime type.
Sprockets.register_preprocessor 'text/css', AddComment
```
Upgrading from Old Versions of Rails
------------------------------------
There are a few issues when upgrading from Rails 3.0 or Rails 2.x. The first is
moving the files from `public/` to the new locations. See [Asset
Organization](#asset-organization) above for guidance on the correct locations
for different file types.
Next is updating the various environment files with the correct default
options.
In `application.rb`:
```ruby
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
# Change the path that assets are served from config.assets.prefix = "/assets"
```
In `development.rb`:
```ruby
# Expands the lines which load the assets
config.assets.debug = true
```
And in `production.rb`:
```ruby
# Choose the compressors to use (if any)
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :yui
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs.
config.assets.digest = true
# Precompile additional assets (application.js, application.css, and all
# non-JS/CSS are already added)
# config.assets.precompile += %w( admin.js admin.css )
```
Rails 4 and above no longer set default config values for Sprockets in `test.rb`, so
`test.rb` now requires Sprockets configuration. The old defaults in the test
environment are: `config.assets.compile = true`, `config.assets.compress = false`,
`config.assets.debug = false` and `config.assets.digest = false`.
The following should also be added to your `Gemfile`:
```ruby
gem 'sass-rails', "~> 3.2.3"
gem 'coffee-rails', "~> 3.2.1"
gem 'uglifier'
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册