2

I am using figaro gem in Rails 5.1. I have a custom bash script too that sets the ENV vars so that we do not have to set them in application.yml and still utilize Figaro.env.{var_name} to access those env var values. Today I noticed that in controllers figaro is not picking those ENV vars. Like in custom.sh, I have following S3_DEVELOPER_NAME: myname

and when I do Figaro.env.s3_developer_name inside controller, it is not outputting myname and rather outputting nil.

Can anybody adds something in my knowledge which I am missing?

Note: If i set s3_developer_name inside application.yml, it works fine in controller too.

Mohsin Sethi
  • 803
  • 4
  • 16

1 Answers1

0

ENV variables are case sensitive, and so is Ruby. So if you define S3_DEVELOPER_NAME: myname, you should call it as Figaro.env.S3_DEVELOPER_NAME.

bert bruynooghe
  • 2,985
  • 1
  • 20
  • 18