Step-by-step guide to setup a local dev environment. This is meant for Linux users, and has been tested with Pop_OS 20.04.
- Install RVM
The setup for RVM on Ubuntu/Pop_OS is described here
- Install Ruby
rvm install 2.6.4
- Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
This script is supposed to add a few lines to your shell profile. If it's not working, you can add this at the end of your .zshrc
or .bashrc
.
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
More infos here.
- Install Node
nvm install 8.17.0
- Install Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
- Install nodes packages
yarn install
- Install
sudo apt install postgresql postgresql-contrib
You can then connect as postgres (the default user).
sudo -i -u postgres
More infos here
- Create user
postgres@server:~$ createuser -s -P chouette
When prompted for the password enter the highly secure string chouette
.
To reconnect your regular user just type exit
.
- Dependencies
sudo apt install libproj-dev postgis libmagickwand-dev libmagic-dev libpq-dev
- Bundle
Clone chouette-core repo, go into the new folder. The RVM gemset is created at that point, and the shell output should look like this :
ruby-2.6.4 - #gemset created /home/user/.rvm/gems/ruby-2.6.4@chouette
ruby-2.6.4 - #generating chouette wrappers - please wait
Add the bundler gem
gem install bundler
Install gems
bundle install
- Create database
bundle exec rake db:create db:migrate
- Seed
bundle exec rake db:seed
Launch Delayed jobs
bundle exec rake jobs:work
Launch webpack server to compile assets on the fly
bin/webpack-dev-server
Launch rails server
bundle exec rails server
You will then have access to your local server on http://localhost:3000
, where you can create an account.
The next step could be to import a set of sample data to populate the local database.
Well done :)