0

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:

  1. If I set a ENV["EMAIL_USERNAME"] from the ruby script, will rails be able to read it?
  2. Running foreman in that way seems like doens't work. It just stuck. Is there another way?

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.

PS: It could be in bash too.

caarlos0
  • 20,020
  • 27
  • 85
  • 160

1 Answers1

1

Well, I made it work following glenn jackman's link: Spawn a background process in Ruby

Just call exec instead of put the command between `

Thanks.

Community
  • 1
  • 1
caarlos0
  • 20,020
  • 27
  • 85
  • 160