:base_path: <%= "#{ENV['GEMSTASH_HOME']}/data" %>
:cache_type: memory
:rubygems_url: https://rubygems.org
:puma_threads: 16
:bind: tcp://0.0.0.0:9292
:protected_fetch: false
:fetch_timeout: 20
:log_file: :stdout

<% if ENV['GEMSTASH_DB_ADAPTER'] == 'mysql2' %>
# mysql2 adapter
:db_adapter: mysql2
:db_url: <%= "mysql2://#{ENV['GEMSTASH_DB_USERNAME']}:#{ENV['GEMSTASH_DB_PASSWORD']}@#{ENV['GEMSTASH_DB_HOST']}:#{ENV['GEMSTASH_DB_PORT']}/#{ENV['GEMSTASH_DB_DATABASE']}" %>
# sqlite adapter (default)
:db_adapter: sqlite
:db_url: sqlite://gemstash.db
<% end %>

:base_path: <%= "#{ENV['GEMSTASH_HOME']}/data" %>
:cache_type: memory
:rubygems_url: https://rubygems.org
:puma_threads: 16
:bind: tcp://0.0.0.0:9292
:protected_fetch: false
:fetch_timeout: 20
:log_file: :stdout

<% if ENV['GEMSTASH_DB_ADAPTER'] == 'mysql2' %>
# mysql2 adapter
:db_adapter: mysql2
:db_url: {}
:db_connection_options:
  :adapter: 'mysql2'
  :host: <%= ENV['GEMSTASH_DB_HOST'] %>
  :port: <%= ENV['GEMSTASH_DB_PORT'] %>
  :database: <%= ENV['GEMSTASH_DB_DATABASE'] %>
  :user: <%= ENV['GEMSTASH_DB_USERNAME'] %>
  :password: <%= ENV['GEMSTASH_DB_PASSWORD'] %>
  :test: true
# sqlite adapter (default)
:db_adapter: sqlite
:db_url: sqlite://gemstash.db
<% end %>

Configure mysql2 adapter as per official documentation
Configure mysql2 adapter as per official documentation

http://sequel.jeremyevans.net/rdoc/files/doc/opening_databases_rdoc.html#label-mysql2
http://www.rubydoc.info/gems/mysql2#Connection_options
