Guest User

Untitled

a guest
Oct 17th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. # config/database.yml
  2. default: &default
  3. adapter: mysql2
  4. encoding: utf8
  5. pool: 5
  6. username: <%= ENV['DATABASE_USERNAME'] %>
  7. password: <%= ENV['DATABASE_PASSWORD'] %>
  8. socket: /var/run/mysqld/mysqld.sock
  9.  
  10. development:
  11. <<: *default
  12. database: <%= ENV['DATABASE_NAME'] %>
  13. test:
  14. <<: *default
  15. database: <%= ENV['DATABASE_NAME'] %>
  16. production:
  17. <<: *default
  18. database: <%= ENV['DATABASE_NAME'] %>
  19. username: <%= ENV['DATABASE_USERNAME'] %>
  20. password: <%= ENV['DATABASE_PASSWORD'] %>
  21.  
  22. # config/application.rb
  23. config = YAML.load(File.read(File.expand_path('../application.yml', __FILE__)))
  24. config.merge! config.fetch(Rails.env, {})
  25. config.each do |key, value|
  26. ENV[key] = value.to_s unless value.kind_of? Hash
  27. end
  28.  
  29. # config/application.yml
  30. development:
  31.  
  32. DATABASE_USERNAME: "username goes here"
  33. DATABASE_PASSWORD: "password goes here"
  34. DATABASE_NAME: "database name goes here"
  35.  
  36. SECRET_KEY_BASE: "secret key goes here"
  37.  
  38. test:
  39.  
  40. DATABASE_USERNAME: "username goes here"
  41. DATABASE_PASSWORD: "password goes here"
  42. DATABASE_NAME: "database name goes here"
  43.  
  44. SECRET_KEY_BASE: "secret key goes here"
  45.  
  46. production:
  47.  
  48. DATABASE_USERNAME: "username goes here"
  49. DATABASE_PASSWORD: "password goes here"
  50. DATABASE_NAME: "database name goes here"
  51.  
  52. SECRET_KEY_BASE: "secret key goes here"
  53.  
  54. Rails.application.secrets
  55.  
  56. SECRETS[:my_secret_key]
  57.  
  58. rails g config:install
  59.  
  60. config/settings.yml
  61. config/settings/development.yml
  62. config/settings/production.yml
  63. config/settings/test.yml
Add Comment
Please, Sign In to add comment