Giter Club home page Giter Club logo

Comments (2)

beccasaurus avatar beccasaurus commented on July 24, 2024 1

The configuration files use in this application provide a section for each environment, eg. development or production.

The Getting Started documentation demonstrates how to connect to your remote database when developing locally, eg. using Cloud SQL or Cloud Datastore. You can, however, configure different settings for your development and production environments.

To configure your database settings per environment, edit your config/database.yml file:

mysql_settings: &mysql_settings
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: your-mysql-user-here
  # ...

development:
  <<: *mysql_settings

production:
  <<: *mysql_settings

For this tutorial, the development and production settings are shared. To use different settings, update this file like so:

development:
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: your-DEVELOPMENT-mysql-user-here
  # ...

production:
  adapter: mysql2
  encoding: utf8
  pool: 5
  username: your-PRODUCTION-mysql-user-here
  # ...

You can do the same for your config/settings.yml file, eg. as is used to configure Cloud Storage uploads or Google Authentication:

default: &default
  oauth2:
    client_id: your-client-id
    # ......

development:
  <<: *default

production:
  <<: *default

Can be changed to:

development:
  oauth2:
    client_id: your-client-id
    # ......

production:
  oauth2:
    client_id: your-client-id
    # ......

from getting-started-ruby.

MarkBennett avatar MarkBennett commented on July 24, 2024

Thanks for the quick reply! That's really helpful and just what I needed.

from getting-started-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.