Skip to content

Developing icare on Debian Ubuntu

Steven Carlson edited this page Jun 3, 2022 · 10 revisions

Ruby on Rails

NOTE: This wiki is about setting up a new development environment. If you have suggestions or just find mistakes/typos feel free to edit this wiki.

This guide has been tested on Ubuntu 20.04 (Focal Fossa).

RVM

gpg --keyserver keys.openpgp.org --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
sudo apt-get install software-properties-common
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm
echo 'source "/etc/profile.d/rvm.sh"' >> ~/.bashrc

Reboot the system (really)

Install requirements with rvm requirements

Change terminal settings in Ubuntu to load login shell

Ref:

Node.js

Install Node.js

curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt install nodejs

Yarn

Install Yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
sudo apt update
sudo apt install yarn

Ruby

rvm install 3.0.2 --verify-downloads 1
rvm use 3.0.2 --default

RubyGems

rvm rubygems current

Rails and Bundler

gem install rails
gem install bundler

To complete correctly the installation of rails, be sure that you have libgmp-dev installed.

Database

Postgres

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
RELEASE=$(lsb_release -cs)
echo "deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo tee  /etc/apt/sources.list.d/pgdg.list
sudo apt -y install postgresql-11

Geospatial extensions (PostGIS + GEOS)

sudo apt install -y postgresql-11-postgis-3
sudo apt install libgeos-dev -y

Background processing

Redis

sudo apt install redis-server

Git and Github

sudo apt install git
git config --global user.name "Your Name Here"
git config --global user.email "your_email@youremail.com"
git config --global credential.helper cache
git config --global core.editor vi

Then Set up your SSH Keys

Local development

Clone the repository

git clone git@github.com:diowa/icare.git
cd icare
git checkout -b develop origin/develop
git pull

Install gems

Switch to icare folder and run

bundle install

Configuration

cp config/settings/local.rb.example config/settings/local.rb
gedit config/settings/local.rb &

Replace gedit with your editor

  1. Generate a new secret_token with rake secret and replace SECRET_TOKEN
  2. Configure a new facebook app for local development and replace NAMESPACE, FACEBOOK_APP_ID and FACEBOOK_SECRET.

Create database

rake db:create

Run icare

At this point, you should be able to properly run icare with rails s command

Optional Steps

Heroku Toolbelt

sudo snap install --classic heroku
heroku login
  1. Login with your credentials
  2. Follow Instructions for an existing application

gitflow

sudo apt install git-flow -y

Run git flow init with default settings in the repository folder

RailsPanel

https://chrome.google.com/webstore/detail/railspanel/gjpfobpafnhjhbajcjgccbbdofdckggg

References

Clone this wiki locally