[英]Start foreman from a Ruby Script
I just created a script/run in my project in the following way: 我只是通过以下方式在项目中创建了一个脚本/运行:
#!/usr/bin/env ruby
# set some ENV variables..
`foreman start -f Procfile.dev`
So, I have some questions: 所以,我有一些问题:
ENV["EMAIL_USERNAME"]
from the ruby script, will rails be able to read it? ENV["EMAIL_USERNAME"]
,rails是否可以读取它? Yeah, I do know that I cant export a ENV variable to PATH, but I wish I can made the variable be exported to the app only. 是的,我确实知道我不能将ENV变量导出到PATH,但我希望可以将变量仅导出到应用程序。
PS: It could be in bash too. PS:也可能会受到打击。
Well, I made it work following glenn jackman's link: Spawn a background process in Ruby 好吧,我按照glenn jackman的链接进行了工作: 在Ruby中生成后台进程
Just call exec instead of put the command between ` 只需调用exec而不是将命令放在`之间
Thanks. 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.