diff --git a/Gemfile b/Gemfile index 28799e49..5717fb2e 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,8 @@ ruby '2.3.1' gem 'rails', '~> 5.0.0', '>= 5.0.0.1' # Use sqlite3 as the database for Active Record gem 'sqlite3' +# Use postgres as the database for Active Record +gem 'pg' # Use Puma as the app server gem 'puma', '~> 3.0' # Use SCSS for stylesheets diff --git a/Gemfile.lock b/Gemfile.lock index 0857cd9d..ccd8f2c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -131,6 +131,7 @@ GEM omniauth-twitter (1.2.1) json (~> 1.3) omniauth-oauth (~> 1.1) + pg (0.19.0) puma (3.6.0) rack (2.0.1) rack-test (0.6.3) @@ -225,6 +226,7 @@ DEPENDENCIES omniauth (= 1.3.1) omniauth-google-oauth2 (= 0.4.1) omniauth-twitter (= 1.2.1) + pg puma (~> 3.0) rails (~> 5.0.0, >= 5.0.0.1) rails-timeago (~> 2.0) diff --git a/config/database.yml b/config/database.yml index 406b2341..3d09a0db 100644 --- a/config/database.yml +++ b/config/database.yml @@ -21,5 +21,10 @@ test: database: db/test.sqlite3 production: - <<: *default - database: db/production/production.sqlite3 + adapter: <%= ENV['DB_ADAPTER'] || 'sqlite3' %> + host: <%= ENV['DB_HOST'] %> + database: <%= ENV['DB_NAME'] || 'db/production/production.sqlite3' %> + username: <%= ENV['DB_USERNAME'] %> + password: <%= ENV['DB_PASSWORD'] %> + pool: <%= ENV['DB_POOL'] || 5 %> + timeout: <%= ENV['DB_TIMEOUT'] || 5000 %> diff --git a/env b/env index deb8e766..2c49bf57 100644 --- a/env +++ b/env @@ -47,7 +47,7 @@ SMTP_PASSWORD=yourpassword # Twitter Login Provider (optional) # # You will need to register the app at https://apps.twitter.com/ -# For the callback URL use 'http:///users/auth/twitter/callback' +# For the callback URL use 'http:///auth/twitter/callback' # Once registered copy the ID and Secret here # TWITTER_ID= @@ -57,7 +57,7 @@ TWITTER_SECRET= # # You will need to register for at https://console.developers.google.com/apis/credentials # Select Oauth client ID -> web application -# For the callback URL use 'http:///users/auth/google/callback' +# For the callback URL use 'http:///auth/google/callback' # Once registered copy the ID and Secret here # GOOGLE_OAUTH2_ID=