Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # config/database.yml
- default: &default
- adapter: mysql2
- encoding: utf8
- pool: 5
- username: <%= ENV['DATABASE_USERNAME'] %>
- password: <%= ENV['DATABASE_PASSWORD'] %>
- socket: /var/run/mysqld/mysqld.sock
- development:
- <<: *default
- database: <%= ENV['DATABASE_NAME'] %>
- test:
- <<: *default
- database: <%= ENV['DATABASE_NAME'] %>
- production:
- <<: *default
- database: <%= ENV['DATABASE_NAME'] %>
- username: <%= ENV['DATABASE_USERNAME'] %>
- password: <%= ENV['DATABASE_PASSWORD'] %>
- # config/application.rb
- config = YAML.load(File.read(File.expand_path('../application.yml', __FILE__)))
- config.merge! config.fetch(Rails.env, {})
- config.each do |key, value|
- ENV[key] = value.to_s unless value.kind_of? Hash
- end
- # config/application.yml
- development:
- DATABASE_USERNAME: "username goes here"
- DATABASE_PASSWORD: "password goes here"
- DATABASE_NAME: "database name goes here"
- SECRET_KEY_BASE: "secret key goes here"
- test:
- DATABASE_USERNAME: "username goes here"
- DATABASE_PASSWORD: "password goes here"
- DATABASE_NAME: "database name goes here"
- SECRET_KEY_BASE: "secret key goes here"
- production:
- DATABASE_USERNAME: "username goes here"
- DATABASE_PASSWORD: "password goes here"
- DATABASE_NAME: "database name goes here"
- SECRET_KEY_BASE: "secret key goes here"
- Rails.application.secrets
- SECRETS[:my_secret_key]
- rails g config:install
- config/settings.yml
- config/settings/development.yml
- config/settings/production.yml
- config/settings/test.yml
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement