Skip to content

HOWTO dev generic_dev_environment

steveoro edited this page Jan 16, 2021 · 2 revisions

HOWTO: generic Dev environment

This document describes the typical working environment for any contributing developer and the expected work-flow.

'TLDR:

You can follow the walkthrough steps here: (GoRails for Ubuntu 18.04)

Setup Checklist

The typical Dev machine is a Linux box connected to the net, with the latest version of Git, capable of SSH'ing for remote access (push to GitHub repos) and compiling sources using the development packages required by the projects' bundle rebuild (whenever needed).

To have a fully configured development machine you'll need:

  1. Your favorite editor/IDE. This Dev team currently recommends Visual Studio Code due to its great API Blueprint Viewer capabilities (get it as a snap using your favourite package manager). Alternatively, you can go with Atom; but even Vim can work flawlessly (Vim for Rubist).

  2. Install your DBMS of choice (MySQL/MariaDB/Postgresql/MongoDB/Redis) from your chosen distro packaging solution or depending on the project requirements.

  3. Choose a Ruby Version manager, Rbenv or RVM, in order to be able to handle different Ruby environment or bundles. RVM allows a clean slate between multiple projects, allowing separated bundles for each project, while Rbenv is a lighter solution that acts only on environment variables. Your truly recommends RVM over any other choice due to its great versatility.

  4. Install Guard & an environment pre-loader, like Zeus or Spring. Environment preloaders allow you to quickly run multiple console commands or spec tests, without a full application reload each time. For local Continuous-Integration setups, this is a must.

  5. Check-out/clone the repo for each project. Open a console in a parent dir (e.g. projects) that will hold all the required projects, and type: git clone <REPO_URL>

  6. cd to project directory, so that RVM will automatically select the correct bundle for the current console (all available projects should be already configured for this).

  7. Remember to launch any task or related activity directly from the project root (spring start, guard, any required rake task and so on...)

Each project has its own configuration.

Hidden .versions files will tell RVM which version of Ruby & which set of gems needs to be used as soon as you enter the root directly of the project tree.

A single development machine configured this way can easily run the DB server running in background with at least three open console tabs, having:

  • a running instance of Guard (together with a Rails Preloader) from the current project's root
  • a running Rails console
  • a running Rails server

Follow through Docker intro & Docker setup if your project needs containers.

Clone this wiki locally