Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
About Environment Variables (modrails.com)
19 points by FooBarWidget on June 4, 2013 | hide | past | favorite | 5 comments


Don't forget you can specify environment variables when you start a new process from bash,

  > APXS2=/usr/sbin/apxs2 ruby -e 'p ENV["APXS2"]'
  "/usr/sbin/apxs2"


    The PATH environment [...] is a *comma-separated* list
It's a colon-separated list.

Apart from that, nice overview of Env vars.


Doh, typo. Fixing that. :)


I've found this process unreliable enough (is it set in the Apache user env, or httpd.conf? Why isn't it getting passed through to Passenger?) that I just put everything into a /usr/local/my-app.yml file, and explicitly load it in application.rb.

http://railscasts.com/episodes/85-yaml-configuration-revised


This is why I've never been a big fan of using environment variables for app configuration. It seems like a clean enough abstraction, but when you start investigating the differences between distributions, applications, and even different packages of the same application, it can get pretty unwieldy. Everyone I raise this argument with replies with something along the lines of, "It's easy if you do it <this way>!" Where <this way> is some prescribed method that works in their environment. Change one aspect of their stack, and that method no longer works. It's a failure of portability that drives me crazy. I don't like marrying myself to a specific platform to that degree.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: