Eric Chua


450 Experience
4 Lessons Completed
0 Questions Solved


Here's how we can do it manually, so we can continue the course (since the command db:system:change can't work)

  1. Open gemfile

comment out sqlite, and add pg gem (find the latest version from rubygems)

Use sqlite3 as the database for Active Record

gem 'sqlite3', '~> 1.4'

Use pg as the database for Active Record

gem 'pg', '~> 1.2', '>= 1.2.3'

  1. Open config/database.yml

copy all from

and replace the existing file

  1. run this

rails db:setup


rails db:migrate

It works.

I tried to fall back to ruby 2.7.5, still same error. Any help?

Posted in The Rails db:system:change command Discussion

I am stuck with this (under part 38 of the beginner series too), same issue

On my Mac, i am getting this error

rails db:system:change --to=postgresql
Running via Spring preloader in process 42311
invalid option: --to=postgresql

Any idea?

For those who struggled to push the codes on Mac now

Have to do this

brew install gh

gh auth login

Choose (not enterprise), https, Y, login to, then can work

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2023 GoRails, LLC. All rights reserved.