Comments (2)
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.
Thanks for the quick reply! That's really helpful and just what I needed.
from getting-started-ruby.
Related Issues (20)
- Datastore Tutorial Issue HOT 1
- testing: enable the Build Cop Bot HOT 1
- Pub/Sub README bug - should copy settings, not secret HOT 1
- Pub/Sub foreman worker raises exception if Topic doesn't exist
- Update sample and bookshelf tutorial docs with gem "google-cloud-ruby" HOT 2
- The example using Datastore should use google-cloud-datastore and not gcloud
- Move this sample into ruby-docs-samples HOT 1
- Remove Fog in favor of using google-cloud-storage directly
- Simplify Datastore book model - Don't use ActiveModel HOT 1
- Remove .ruby-version HOT 1
- Upgrade to latest version of Rails 5 HOT 1
- Don't use Datastore emulator for tests HOT 4
- OAuth URLs are not valid during beta of Flexible App Engine HOT 3
- New lookup job errors if it cant find a book HOT 1
- Update Container Engine Google Cloud gem dependencies
- Update Cloud SDK installation instruction in main README HOT 1
- Pub/Sub Example Should Delete Subscription
- RuntimeError: Could not load the default credentials. HOT 3
- Bookshelf on Kubernetes Engine Tutorial: Backend doesn't start HOT 9
- using KMS for managing secrets for database credentials HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from getting-started-ruby.