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

Docs: Update installation guide with PostGIS setup steps #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions website/docs/dev-documentation/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ description: Installation instructions
| 0.28 | coming soon |
| 0.29 | coming soon |

To install Decidim Geo, you need a [Posgis](https://postgis.net/) extension installed.
## Prerequisites
To install Decidim Geo, ensure you have the [PostGIS](https://postgis.net/) extension installed and enabled on your PostgreSQL database.

### Install Decidim Geo

Add the gem to your Gemfile
```
gem "decidim-decidim_geo", version: "~> 0.2.6"
gem 'decidim-decidim_geo', '~> 0.2.1'
```

Add javascripts libraries
Expand All @@ -29,7 +30,7 @@ Add javascripts libraries

Copy migrations and migrate
```
bundle exec rails decidim_geo:migration:install
bundle exec rails decidim_geo:install:migrations
bundle exec rails db:migrate
```

Expand All @@ -48,3 +49,31 @@ Assets compilations should pass.
```
bundle exec rails assets:precompile
```
### Tips for Installing [PostGIS](https://postgis.net/)
If you haven't installed PostGIS yet, follow these steps:

```sh
sudo apt update && sudo apt install postgis postgresql-14-postgis-3
```
Enable the PostGIS extension inside your PostgreSQL database:
```sql
CREATE EXTENSION postgis;
```

Modify your `docker-compose.yml` file to use PostGIS:
```yaml
pg:
image: postgis/postgis:latest
environment:
POSTGRES_PASSWORD: postgres
Run the following command to add the required gem:
```sh
echo 'gem "activerecord-postgis-adapter"' >> Gemfile
```

Modify the file database.yml, changing the adapter to ``postgis``

Then, install the dependencies:
```sh
bundle install
```