ddollar / foreman

Manage Procfile-based applications
http://ddollar.github.com/foreman
MIT License
6.03k stars 633 forks source link

Multiline ENV vars not working when using Dotenv with Foreman #755

Open pezholio opened 4 years ago

pezholio commented 4 years ago

I've recently encountered a problem when using Foreman in conjunction with Dotenv on a Rails project. I've got a ENV file with a multiline string like so:

MULTILINE_ENV_VAR="
Here is
a multiline
env var
"

When I spin up the application as normal (i.e. bundle exec rails s) the env var works as expected, however, if I add the command to a Procfile like so:

web: bundle exec rails s

And run foreman start, the ENV var gets munged. I've created an example Rails project here to demonstrate the error. Here's some screenshots too:

With rails s

image

With foreman start

image

I'm not sure if this is a bug with Dotenv or Foreman, but thought it best to try here first.