Fixes bug in category#index view and adds tests

There is a bug in the category#index view since it is expecting an article object to exist. It seems it was intended to only display categories with published articles so I added the code needed for that (and tests). I also moved dotenv-rails in the Gemfile so that it is included in the production env.