These prerequisites assume you're working on a Linux-based operating system but have been tested on Ubuntu 18.04.
rbenv install 2.6.1)
For very detailed rbenv installation directions on several distros, please visit DigitalOcean's guide.
There are two ways to install Yarn.
npm install -g yarnto install Yarn.
sudo apt update && sudo apt install postgresql postgresql-contrib libpq-dev.
sudo -u postgres psqlwhich should open a PostgreSQL prompt. Exit the prompt by running
sudo -u postgres createuser -s $YOUR_USERNAMEwhere $YOUR_USERNAME is the username you are currently logged in as. Lastly, at least on Debian based systems, in the codebase under /config/database.yml you'll want to comment out the
host: localhostto configure the database to use Unix domain sockets as outlined here.
git clone https://github.com/<your-username>/dev.to.git
gem install bundler
gem install foreman
Setup your database
config/database.ymlby copying from the provided template (i.e.
cp config/database.yml.sample config/database.yml)
config/database.yml file if needed.
Set up your environment variables/secrets
Envfile. This file lists all the
ENVvariables 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.ymlby copying from the provided template (ie. with bash:
cp config/sample_application.yml config/application.yml). This is a personal file that is ignored in git.
``` GITHUB_KEY: "SOME_REAL_SECURE_KEY_HERE" GITHUB_SECRET: "ANOTHER_REAL_SECURE_KEY_HERE" ```
ENVvariables on bootup,
enviedgem will alert you with messages similar to
'error_on_missing_variables!': The following environment variables should be set: A_MISSING_KEY..
You do not need "real" keys for basic development. Some features require certain keys, so you may be able to add them as you go.