This workshop will be retired on May 1, 2025.
Heads up! To view this whole video, sign in with your Courses Plus account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Let's take an existing Rails app, and convert it from using SQLite to PostgreSQL.
In your terminal:
git clone https://github.com/treehouse-projects/rails-guestbook.git guestbook
Edit the project Gemfile
:
# Replace:
gem 'sqlite3'
# With:
gem 'pg', '~> 0.18'
In your terminal:
bundle install
Edit config/database.yml
:
default: &default
adapter: postgresql
encoding: unicode
pool: 5
development:
<<: *default
database: guestbook_development
username: <YOUR_POSTGRESQL_USER_NAME>
test:
<<: *default
database: guestbook_test
username: <YOUR_POSTGRESQL_USER_NAME>
production:
<<: *default
database: guestbook_production
username: deploy
In your terminal:
bin/rails db:setup
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up