Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure bin/setup works #1242

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Ensure bin/setup works #1242

merged 1 commit into from
Dec 5, 2024

Conversation

stevepolitodesign
Copy link
Contributor

@stevepolitodesign stevepolitodesign commented Dec 5, 2024

Closes #1224

It's unclear why we need to run migrations, since we're already calling
db:prepare which does the following:

If the database exists but the tables have not been created, the
command will load the schema, run any pending migrations, dump the
updated schema, and finally load the seed data. See the Seeding Data
documentation for more details.

However, I found that calling db:migrate in the application template
worked.

@stevepolitodesign
Copy link
Contributor Author

This might need more work.

bin/rails aborted!
ActiveRecord::NoDatabaseError: We could not find your database: app_name_development. Available database configurations can be found in config/database.yml. (ActiveRecord::NoDatabaseError)

To resolve this error:

- Did you not create the database, or did you delete it? To create the database, run:

    bin/rails db:create

- Has the database name changed? Verify that config/database.yml contains the correct database name.


Caused by:
PG::ConnectionBad: connection to server on socket "/tmp/.s.PGSQL.5432" failed: FATAL:  database "app_name_development" does not exist (PG::ConnectionBad)

I might need to call both?

Closes #1224

It's unclear why we need to run migrations, since we're already calling
[db:prepare][dbp] which does the following:

> If the database exists but the tables have not been created, the
command will load the schema, run any pending migrations, dump the
updated schema, and finally load the seed data. See the Seeding Data
documentation for more details.

However, I found that calling `db:migrate` in the application template
worked.

[dbp]: https://guides.rubyonrails.org/active_record_migrations.html#preparing-the-database
@stevepolitodesign stevepolitodesign merged commit a4a4af0 into main Dec 5, 2024
2 checks passed
@stevepolitodesign stevepolitodesign deleted the sp-1224 branch December 5, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running bin/setup fails after generating a new app
1 participant