Ruby system with environment variables

23 Sep 2013

When running a bash command from Ruby with a environment variable. Don't do this:

system('GARUDA_ENV=prod echo $GARUDA_ENV')

It won't work… Please do this

system({"GARUDA_ENV" => "prod"}, 'echo $GARUDA_ENV') ``

Give it a kudos