![](/img/trans.png)
[英]What's wrong with this Procfile? (heroku + rails + Resque)
[英]What does ${PORT:-3000} mean in Heroku Procfile?
Heroku建议使用此Procfile命令在Rails 5安装程序上启动Puma :
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}
起初,我以为3000是默认值,但实际上,如果开发中缺少PORT
则领班使用端口5000。
问题:符号${VARIABLE:-3000}
是什么意思?
-
更新:看来puma是元凶: 工头/ Puma没有在dev env中使用指定的端口
这是VARIABLE
的默认值。
使用默认值。 如果参数未设置或为null,则替换单词的扩展名。 否则,将替换参数的值。
在这种情况下,如果未设置PORT
变量,则其值将为3000
;类似地,如果未设置RACK_ENV
则其将被development
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.