Issue
By default in rails,
commands like rails db:create or rails db:migrate are supposed to work in both devlopment and test environments,
but It doesn't work that way on gitpod.
# this create only development database in gitpod
rails db:create
# we need to set RAILS_ENV=test
rails db:create RAILS_ENV=test
Current Possible Causes
This is supposed to be caused because gitpod sets ENV["DATABASE_URL"].
(*In the local development, ENV["DATABASE_URL"] is nil. This is why both development and test migrates are executed correctly at local).
https://github.com/rails/rails/pull/39027/files
Solutions for this issue
I have not yet found a solution for this. I can't set or unset ENV["DATABASE_URL"] on gitpod.
Discussion about current behavior
I want to run rails db:migrate for both development and test environment, but there seems to be a lot of support for current behavior.
Issue
By default in rails,
commands like
rails db:createorrails db:migrateare supposed to work in bothdevlopmentandtestenvironments,but It doesn't work that way on gitpod.
Current Possible Causes
This is supposed to be caused because gitpod sets
ENV["DATABASE_URL"].(*In the local development,
ENV["DATABASE_URL"]is nil. This is why bothdevelopmentandtestmigrates are executed correctly at local).https://github.com/rails/rails/pull/39027/files
Solutions for this issue
I have not yet found a solution for this. I can't set or unset
ENV["DATABASE_URL"]on gitpod.Discussion about current behavior
I want to run
rails db:migratefor bothdevelopmentandtestenvironment, but there seems to be a lot of support for current behavior.