cadwallion on github-actions
Switch to release event The `r… (compare)
script/serverand the app just works
:groups => …part
CORE_API_URL = 'coreapi.com'
CORE_API_URL = 'coreapi.test'
I'm experiencing a bit of a headscratcher... I have a class in a Rails application where I have a constant defined, i.e.
class MyClass MY_CONST = ENV["MY_VAR"] puts MY_CONST
if I put MY_VAR in .env, the value is properly loaded, but if I put it in .env.development.local, it ends up as nil. Is this expected behavior? Based on my understanding, since the class is getting created before application.initialize, I would expect it to not work whether I put it in .env or .env.development, if I don't call Dotenv.Railtie.load prior to defining MY_CONST.
puts ENV["MY_VAR"]in the Application class, the puts in MyClass occurs first, then the one in Application. When MY_VAR is defined in .env, it shows up correctly in both puts statements, when it is in .env.development, it has no value in MyClass but does have the correct value in Application
i have a problem with my rails app and dotenv, i cannot read values from .env in the app root
who can help me out?
it reads from shell env vars, but not from the .env file . i need to read RAILS_ENV variable and set it to Rails.env automatically or explicitly
so the goal is to use proper environment depending on RAILS_ENV which we read from env specific file
what i did
gem "dotenv-rails" to Gemfile
2( bundle install
3) added explicit
Test command: bundle exec rails c
it shows me
development. But i expect staging cause i have this in <root>/.env
gem "rails", "5.2.3"
ruby -v ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux-gnu]