问题描述
这两个任务之间有什么区别,为什么在部署帽子时需要添加RAILS_ENV = production?
what's the differences between these two tasks, why i need to add RAILS_ENV=production when cap deploy?
谢谢!
推荐答案
您需要指定RAILS_ENV=production
环境变量,以便在预编译资产时使用config/environments/production.rb
配置文件.它通常包含资产管道的生产配置:
You need to specify RAILS_ENV=production
environment variable so that your config/environments/production.rb
configuration file is used when precompiling assets. It usually contains production configuration for assets pipeline:
config.assets.js_compressor = :uglifier
config.assets.digest = true
如果省略RAILS_ENV=production
,则将使用development
配置(config/environments/development.rb
).
If you omit RAILS_ENV=production
then development
configuration will be used (config/environments/development.rb
).
这篇关于rake资产:预编译和RAILS_ENV =生产rake资产:预编译有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!