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

Problemas con create db o cualquier comando con database #14

Open
BenjaminTala opened this issue Aug 29, 2023 · 3 comments
Open

Problemas con create db o cualquier comando con database #14

BenjaminTala opened this issue Aug 29, 2023 · 3 comments

Comments

@BenjaminTala
Copy link

Segui paso a paso e intente los troubleshoots en los otros issues yu nada me ha servido. Siguiendo paso a pasoo la guia me dio este error al crear el database:

Screenshot 2023-08-29 164739

Tambien intente cambiando directamente el usuario y clave de database.yml y tengo este error:

y me entrego esto:
Screenshot 2023-08-29 164910

Llevo tres dias seguidos haciendo arreglos distintos que me han recomendado y nada me sirve. Espero me puedan ayudar

@BenjaminTala
Copy link
Author

Ahora intente desde mi laptop y tengo este mismo error:

root@Jitalanator:~/CinemaApi# rails db:create
We could not find your database: postgres. Which can be found in the database configuration file located at config/database.yml.

To resolve this issue:

  • Did you create the database for this app, or delete it? You may need to create your database.
  • Has the database name changed? Check your database.yml config has the correct database name.

To create your database, run:

    bin/rails db:create

Couldn't create 'CinemaApi_development' database. Please check your configuration.
rails aborted!
ActiveRecord::NoDatabaseError: We could not find your database: postgres. Which can be found in the database configuration file located at config/database.yml.

To resolve this issue:

  • Did you create the database for this app, or delete it? You may need to create your database.
  • Has the database name changed? Check your database.yml config has the correct database name.

To create your database, run:

    bin/rails db:create

Caused by:
PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "root" does not exist

Tasks: TOP => db:create
(See full trace by running task with --trace)
root@Jitalanator:~/CinemaApi#

@OrregoSilva
Copy link
Contributor

Hola!
Me da la idea que no tienes creado el superusuario de Linux, ya que estás trabajando en root y no en ~. Probablemente, cuando estabas iniciando Ubuntu por primera vez, te saltaste ese paso al apretar enter a las indicaciones. Esta guia te puede ayudar.

@seemab-bukhari
Copy link

Please share database.yml as well.
There are two problems with the above error:

  1. DB name is twice set in the configurations once as postgres and then as CinemaApi_development
  2. Root or any other role doesn't exist in postgres locally. Once the role is created you can set the correct username/password in database.yml

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

No branches or pull requests

3 participants