From e666c28c5c83d27762baa5c49f1bdd94086ad0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 6 Aug 2024 13:50:28 +0200 Subject: [PATCH] Update instructions for the bin/setup command This command simplifies some of the steps. However, there's a gotcha: it might fail if the database requires username and password and they haven't been configured before executing it. --- README.md | 2 ++ README_ES.md | 2 ++ docs/en/README.md | 2 ++ docs/en/installation/local_installation.md | 36 ++++++++++++---------- docs/es/README.md | 2 ++ docs/es/installation/local_installation.md | 36 ++++++++++++---------- 6 files changed, 46 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 3ecdc0d1b..796e34d67 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ You can access the main website of the project at [http://consuldemocracy.org](h Prerequisites: install git, Ruby 3.2.4, CMake, pkg-config, Node.js 18.20.3, ImageMagick and PostgreSQL (>=9.5). +**Note**: The `bin/setup` command below might fail if you've configured a username and password for PostgreSQL. If that's the case, edit the lines containing `username:` and `password:` (adding your credentials) in the `config/database.yml` file and run `bin/setup` again. + ```bash git clone https://github.com/consuldemocracy/consuldemocracy.git cd consuldemocracy diff --git a/README_ES.md b/README_ES.md index 0a7c9a890..dc8b6e553 100644 --- a/README_ES.md +++ b/README_ES.md @@ -36,6 +36,8 @@ Puedes acceder a la página principal del proyecto en [http://consuldemocracy.or Prerrequisitos: tener instalado git, Ruby 3.2.4, CMake, pkg-config, Node.js 18.20.3, ImageMagick y PostgreSQL (9.5 o superior). +**Nota**: Es posible que ejecutar `bin/setup`, como se indica a continuación, falle si has configurado un nombre de usuario y contraseña para PostgreSQL. Si es así, edita las líneas que contienen `username:` y `password:` (añadiendo tus credenciales) en el fichero `config/database.yml` y ejecuta `bin/setup` de nuevo. + ```bash git clone https://github.com/consuldemocracy/consuldemocracy.git cd consuldemocracy diff --git a/docs/en/README.md b/docs/en/README.md index e44305542..d97675d15 100644 --- a/docs/en/README.md +++ b/docs/en/README.md @@ -14,6 +14,8 @@ You can access the main website of the project at [http://consuldemocracy.org](h Prerequisites: install git, Ruby 3.2.4, CMake, pkg-config, Node.js 18.20.3, ImageMagick and PostgreSQL (>=9.5). +**Note**: The `bin/setup` command below might fail if you've configured a username and password for PostgreSQL. If that's the case, edit the lines containing `username:` and `password:` (adding your credentials) in the `config/database.yml` file and run `bin/setup` again. + ```bash git clone https://github.com/consuldemocracy/consuldemocracy.git cd consuldemocracy diff --git a/docs/en/installation/local_installation.md b/docs/en/installation/local_installation.md index 9e0ed9df5..ea56a5a89 100644 --- a/docs/en/installation/local_installation.md +++ b/docs/en/installation/local_installation.md @@ -24,37 +24,39 @@ ruby -v => # (it should be the same as the version in the .ruby-version file) ``` -4. Install the required gems using Bundler: - -```bash -bundle -``` - -5. Copy the environment example configuration files inside new readable ones: +4. Copy the example database configuration file: ```bash cp config/database.yml.example config/database.yml -cp config/secrets.yml.example config/secrets.yml ``` -And setup database credentials with your `consul` user in your new `database.yml` file. - -6. Run the following [Rake tasks](https://github.com/ruby/rake) to create and fill your local database with the minimum data needed to run the application: +5. Setup database credentials with your `consul` user in your new `database.yml` file ```bash -bin/rake db:create -bin/rake db:setup -bin/rake db:dev_seed -bin/rake db:test:prepare +nano config/database.yml ``` -7. Check everything is fine by running the test suite (beware it might take more than an hour): +And edit the lines containing `username:` and `password:`, adding your credentials. + +6. Install the project dependencies and create the database: + +```bash +bin/setup +``` + +7. Run the following [Rake task](https://github.com/ruby/rake) to fill your local database with development data: + +```bash +bin/rake db:dev_seed +``` + +8. Check everything is fine by running the test suite (beware it might take more than an hour): ```bash bin/rspec ``` -8. Now you have all set, run the application: +9. Now you have all set, run the application: ```bash bin/rails s diff --git a/docs/es/README.md b/docs/es/README.md index c40ca1d7b..ce7151aaf 100644 --- a/docs/es/README.md +++ b/docs/es/README.md @@ -14,6 +14,8 @@ Puedes acceder a la página principal del proyecto en [http://consuldemocracy.or Prerrequisitos: tener instalado git, Ruby 3.2.4, CMake, pkg-config, Node.js 18.20.3, ImageMagick y PostgreSQL (9.5 o superior). +**Nota**: Es posible que ejecutar `bin/setup`, como se indica a continuación, falle si has configurado un nombre de usuario y contraseña para PostgreSQL. Si es así, edita las líneas que contienen `username:` y `password:` (añadiendo tus credenciales) en el fichero `config/database.yml` y ejecuta `bin/setup` de nuevo. + ```bash git clone https://github.com/consuldemocracy/consuldemocracy.git cd consuldemocracy diff --git a/docs/es/installation/local_installation.md b/docs/es/installation/local_installation.md index 8a34b5660..6b072ddf2 100644 --- a/docs/es/installation/local_installation.md +++ b/docs/es/installation/local_installation.md @@ -24,37 +24,39 @@ ruby -v => # (debería aparecer la versión mencionada en el fichero .ruby-version) ``` -4. Instala las gemas requeridas usando Bundler: - -```bash -bundle -``` - -5. Copia los archivos de configuración de ejemplo del entorno dentro de unos nuevos válidos: +4. Copia el archivo de ejemplo de configuración de base de datos: ```bash cp config/database.yml.example config/database.yml -cp config/secrets.yml.example config/secrets.yml ``` -Y configura los de tu usuario de base de datos `consul` en `database.yml` - -6. Ejecuta las siguientes [tareas Rake](https://github.com/ruby/rake) para crear y rellenar tu base de datos local con el mínimo de información necesaria para que la aplicación funcione correctamente: +5. Configura las credenciales de base de datos con tu usuario `consul` en tu nuevo fichero `database.yml` ```bash -bin/rake db:create -bin/rake db:setup -bin/rake db:dev_seed -bin/rake db:test:prepare +nano config/database.yml ``` -7. Comprueba que todo funciona correctamente lanzando la suite de tests (ten en cuenta que podría tardar más de una hora): +Y edita las líneas que contienen `username:` y `password:`, añadiendo tus credenciales. + +6. Instala las dependencias del proyecto y crea la base de datos: + +```bash +bin/setup +``` + +7. Ejecuta la siguiente [tarea Rake](https://github.com/ruby/rake) para rellenar tu base de datos local con datos de desarrollo: + +```bash +bin/rake db:dev_seed +``` + +8. Comprueba que todo funciona correctamente lanzando la suite de tests (ten en cuenta que podría tardar más de una hora): ```bash bin/rspec ``` -8. Ahora que ya está todo listo puedes ejecutar la aplicación: +9. Ahora que ya está todo listo puedes ejecutar la aplicación: ```bash bin/rails s