Closed benlieb closed 6 months ago
i've been using yml
files with config_for(:the_thing)
to get the ENV files into rails
# config/the_thing.yml
shared:
base_url: <%= ENV["BASE_URL"] %>
admin_password: <%= ENV["ADMIN_PASSWORD"] %>
does this get you what you need? rather than trying to run ruby and interpolate in the .env
file
@gcentauri I referenced yml files in my question…
@benlieb there is not erb+yaml support built into dotenv, but you could pretty easily load the file yourself:
Dotenv.update YAML.load(ERB.new(Dotenv::Rails.root.join('.env.yml').read).result)
Is there any way to parse this first with ERB (using Rails)?
Similar to how yml files work: