Q:

How do I pass in my API key as an environment variable

I am using themoviedb-api ruby gem in rails 4 and I would like to keep my API key out of git so I though of passing it in as an environment variable. What is the correct syntax? 
In my .env I have 
TMDB_API_KEY=ee27f0e6fxxxxxxxxxxxxxxxx

In my initializers/tmdb.rb I have 
Tmdb::Api.key("KEY_HERE")

I have tried a few different ideas but nothing has worked. Like ENV['TMDB_API_KEY'] for example. 
Thanks in advance.

A:

By default, you can't just stick things in .env and have them work. You'll need to use a gem like dotenv. https://github.com/bkeepers/dotenv
You can then access it using ENV['VAR_NAME']

