I am SSH'd into an OpsWorks Rails App Server and I'm trying to start the Rails console.
This is what I do:
cd /srv/www/appname/current/
RAILS_ENV=production bundle exec rails console
But I get an error because the settings file is expecting environment variables to be present from the OpsWorks config, but they aren't:
in `fetch': key not found: "ELASTICSEARCH_URL" (KeyError)
Form this code:
elasticsearch_url: <%= ENV.fetch('ELASTICSEARCH_URL') %>
The app starts fine and I can use the search feature, so the env vars are clearly getting to the webserver OK. However, when I run printenv
from the command line, there is no sign of them. How can I start the console and include the env vars that OpsWorks has provided to the webserver (Unicorn)?