DEV Community

Discussion on: How to change the database in a Rails application ?

Collapse
coderljy profile image
KenntsuRinn

But when I run the command,

rails db:system:change --to=postgresql

it says that

Running via Spring preloader in process 15186
invalid option: --to=postgresql

my env:

ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux]
Rails 6.1.4.1

Collapse
nemuba profile image
Alef Ojeda de Oliveira Author

Strange here it worked, tested other databases?

Collapse
coderljy profile image
KenntsuRinn

Mysql is the same result.

Thread Thread
inayuky profile image
inayuky

The workaround is to disable 'spring' as follows.

  1. comment out gem 'spring' in the Gemfile
  2. execute "bundle install"

Details are below issue.
github.com/rails/rails/issues/3471...

I fixed this issue by the following PR.
github.com/rails/spring/pull/679