Replies: 3 comments 1 reply
-
Right now, you can only do this via monkey-patching. However, I think it's worth adding an ability to configure the environment for Anyway explicitly and use the Rails one by default ( In general, to run an application with a production-like configuration in development, I'd recommend using a custom parameter (say, |
Beta Was this translation helpful? Give feedback.
-
Added ANYWAY_ENV in v2.4.2 |
Beta Was this translation helpful? Give feedback.
-
Never blogged about it, but I do suggest it. Example in rubygems.org. |
Beta Was this translation helpful? Give feedback.
-
We recently migrated to AnywayConfig from an in house solution to config management, and while overall I am very happy with the transition, there's one task that has gotten harder and I wondered if you had any thoughts on it:
Say I am in a Rails app and want to debug a behaviour that is specific to production mode. Maybe its asset precompilation, or profiling where I don't want Zeitwerk lazy loading.
Previously, I could just set RAILS_ENV=production in my env, and since the rest of my config comes from the env, that is the only config that changes. With AnywayConfig though, RAILS_ENV itself means that my whole config has changed. I cannot isolate this change, and my app is unusable since its on my local dev box, trying to connect to cloud resources it has no access to.
Is there a way for me to boot the app such that RAILS_ENV=staging but AnywayConfig still loads the config as if RAILS_ENV=development?
Beta Was this translation helpful? Give feedback.
All reactions