rake资产:预编译和RAILS_ENV =生产rake资产:预编译有什么区别? [英] what's the differences between rake assets:precompile and RAILS_ENV=production rake assets:precompile?

查看:65
本文介绍了rake资产:预编译和RAILS_ENV =生产rake资产:预编译有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这两个任务之间有什么区别,为什么在部署帽子时需要添加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资产:预编译有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆