Environment variables can not load by Gemfile since v0.8.29.
See original GitHub issueHello. Now I am in trouble…
Up to 0.8.28, environment variables could be loaded in liquid by the following method. But, since 0.8.29, environmental variables can not be read by the above method.
My Gemfile
source 'https://rubygems.org/'
gem 'embulk-input-...'
gem 'embulk-filter-...'
...
gem 'dotenv'
begin
require 'dotenv'
Dotenv.load(File.expand_path('../../.env', __FILE__))
rescue LoadError => e
rescue => e
end
dotenv is a library that can manage environment variables with yaml.
My .env
DATABASE_HOST=localhost
DATABASE_USER=username
DATABASE_PASS=password
DATABASE_NAME=some_database
My liquid file
in:
type: mysql
host: {{ env.DATABASE_HOST }}
user: {{ env.DATABASE_USER }}
password: {{ env.DATABASE_PASS }}
database: {{ env.DATABASE_NAME }}
query: |
select * from users limit 1
out:
type: stdout
Run embulk
$ embulk run -b embulk_bundle config.yml
Did something change around environment variables?
It is running Gemfile on things like Digdag’s --params-file. https://docs.digdag.io/command_reference.html
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Environment variable in Gemfile - ruby on rails - Stack Overflow
I have a heroku_env.rb file that's supposed to mock heroku's environment variables (and it's loaded in my application.rb ). Maybe that's not the ......
Read more >bundle config - Bundler
Executing bundle with the BUNDLE_IGNORE_CONFIG environment variable set will cause it to ignore all configuration. Remembering Options. Flags passed to bundle ...
Read more >Configuration - Rocket Programming Guide
Rocket applications can be configured via a configuration file, through environment variables, or both. Configurations are separated into three environments: ...
Read more >Environment variables - Metabase
Environment variables Many settings in Metabase can be viewed and modified in the Admin Panel, or set via environment variables. The environment variables...
Read more >Hiding Sensitive Information with Environmental Variables in ...
I ran into several issues with my app not loading after starting the server. Installing the dotenv with gem install dotenv did not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@toyama0919 @toyama-h I think this issue would be worked-around by #790, which is released soon as v0.8.33. Can you try that?
@toyama0919 Thanks for your report! Got it… Since v0.8.29, JRuby instances not for plugins (e.g. subcommands, Liquid, Bundler, …) are independent from others to avoid creating (global) JRuby instances in the bootstrap.
Hmm…, let me think about that. That would be non-trivial to keep the un-JRuby’ed bootstrap.