don't put RAILS_ENV into the .env file - chicken and egg

see https://github.com/bkeepers/dotenv/issues/19 for more info
This commit is contained in:
Devin Howard 2016-01-07 18:47:58 +08:00
parent da03d59d46
commit 1c0f6f2e2a
2 changed files with 4 additions and 2 deletions

View file

@ -1,5 +1,3 @@
export RAILS_ENV='development'
export DB_USERNAME='postgres'
export DB_PASSWORD='3112'
export DB_HOST='localhost'

View file

@ -1,9 +1,13 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'dotenv'
Bundler.require(*Rails.groups)
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
Dotenv.load ".env.#{ENV["RAILS_ENV"]}", '.env'
module Metamaps
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.