These prerequisites assume you're working on a Linux-based operating system, but they have only been tested on Ubuntu 18.04.
rbenv install 2.6.5
)For very detailed rbenv installation directions on several distros, please visit DigitalOcean's guide.
There are two ways to install Yarn.
npm install -g yarn
to install Yarn.sudo apt update && sudo apt install postgresql postgresql-contrib libpq-dev
.sudo -u postgres psql
which should open a PostgreSQL prompt. Exit the prompt by running \q
then run sudo -u postgres createuser -s $YOUR_USERNAME
where $YOUR_USERNAME
is the username you are currently logged in as.There are more than one ways to setup PostgreSQL. For additional configuration, check out our PostgreSQL setup guide or the official PostgreSQL site for further information.
DEV uses ImageMagick to manipulate images on upload.
Please refer to ImageMagick's instructions on how to install it.
DEV requires Redis version 4.0 or higher.
We recommend following Digital Ocean's extensive How To Install and Configure Redis on Ubuntu 16.04 (available for other Linux distributions as well) to setup Redis.
git clone https://github.com/<your-username>/dev.to.git
gem install bundler
Set up your environment variables/secrets
Envfile
. This file lists all the ENV
variables we use and provides a fake default for any missing keys. You'll need to get your own free Algolia credentials to get your development environment running.For any key that you wish to enter/replace:
config/application.yml
by copying from the provided template (i.e. with bash: cp config/sample_application.yml config/application.yml
). This is a personal file that is ignored in git.1 2
GITHUB_KEY: "SOME_REAL_SECURE_KEY_HERE" GITHUB_SECRET: "ANOTHER_REAL_SECURE_KEY_HERE"
ENV
variables on bootup, the envied gem will alert you with messages similar to 'error_on_missing_variables!': The following environment variables should be set: A_MISSING_KEY.
.Run bin/setup
While installing, you might run into an error due to the pg
gem requiring PostgreSQL libraries. If so, please run sudo apt-get install libpq-dev
before retrying.
While installing, you might run into an error due to the sass-rails
gem requiring sassc
, which requires the g++
compiler. If so, please run sudo apt-get install g++
before retrying.
While installing, if you didn't install node
or nvm
manually, you might run into an error due to an older system node version being present, which can cause issues while yarn
is installing packages. If so, you'll need to install nvm
and then run nvm install node
to get the most recent node version before retrying.