I have created a Rails gem and a Rails app that uses that gem. The gem is deployed at Gemfury, and I successfully am able to bundle install the gem. In the gem, I have a variable set to an environment variable. When I run my app locally, the places in the app that use environment variables are able to read my environment variables (managed by Figaro), but the gem is not able to. What might I be missing or doing wrong?
For example if I do this in the gem:
cache_enabled = ENV['CACHE_ENABLED'] || false
It will end up as false even if my environment variable CACHE_ENABLED = true. My Rails app reads environment variables with no problem.
I'm using Rails 4 if that makes a difference.
p ENV['CACHE_ENABLED'].class, andp cache_enabledafter the codeline. and show us a result.