为什么工头gem会忽略PORT环境变量? [英] Why is foreman gem ignoring the PORT environment variable?
问题描述
我希望工头gem使用我的开发环境文件中提供的PORT值,而不是使用自己的值。我的文件设置如下所示:
-
开始工头的bash脚本:
foreman start -e development.env
development.env文件内容: -
Procfile内容
PORT = 3000
web:bundle exec rails thin -p $ PORT -e $ RAILS_ENV $ 1
开发服务器最终从端口5000开始。我知道我可以开始工头--p 3000强制它使用该端口。但是这样做打破了env文件的目的。
有什么建议吗?
查看代码: https://github.com/ddollar/foreman/ blob / master / lib / foreman / process.rb 看起来工头只会将PORT作为命令行参数。
I want the foreman gem to use the PORT value provided in the my development env file instead of using its own values. My files setup is shown below:
A bash script to start foreman:
foreman start -e development.env
The development.env file content:
PORT=3000
The Procfile content
web: bundle exec rails server thin -p $PORT -e $RAILS_ENV $1
The dev server ends up starting on port 5000. I know I can start foreman with --p 3000 to force it to use that port. But that defeats the purpose of the env file.
Any suggestions?
Looking at the code: https://github.com/ddollar/foreman/blob/master/lib/foreman/process.rb it looks foreman will only take the PORT as a command line argument.
这篇关于为什么工头gem会忽略PORT环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!