3.8 KiB
3.8 KiB
Installing prerequisites
These prerequisites assume you're working on a Linux-based operating system but have been tested on Ubuntu 18.04.
Ruby
- If you don't already have a Ruby version manager, we highly recommend rbenv. Please follow their installation guide.
- With the Ruby version manager, install the Ruby version listed on our badge. (ie with rbenv:
rbenv install 2.5.3)
For very detailed rbenv installation directions on several distros, please visit DigitalOcean's guide.
Yarn
There are two ways to install Yarn.
- Yarn's official installation guide.
- DigitalOcean's detailed tutorial describes how to install Node version Manager. By installing NVM you can select a Node version (we recommend either LTS or current), the guide will also explain how to install NPM. This way you'll have Node, NPM, and then you can run
npm install -g yarnto install Yarn.
PostgreSQL
- run
sudo apt update && sudo apt install postgresql postgresql-contrib libpq-dev. - To test the installation you can run
sudo -u postgres psqlwhich should open a PostgreSQL prompt. Exit the prompt by running\qthen runsudo -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 thehost: localhostto configure the database to use Unix domain sockets as outlined here.
There are more than one way to setup Postgres. For additional configuration, check out our postgres doc or the official PostgreSQL site for more information.
Installing Dev.to
- Fork dev.to repository, ie. https://github.com/thepracticaldev/dev.to/fork
- Clone your forked repository, ie.
git clone https://github.com/<your-username>/dev.to.git - Install bundler with
gem install bundler - Install foreman gem with
gem install foreman - Install our ruby dependencies with
bundle install - Install our frontend dependencies with
bin/yarn - Set up your environment variables/secrets
- Take a look at
Envfile. This file lists all theENVvariables 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. - This guide will show you how to get free API keys for additional services that may be required to run certain parts of the app.
- For any key that you wish to enter/replace:
-
Create
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. -
Obtain the development variable and apply the key you wish to enter/replace. ie:
GITHUB_KEY: "SOME_REAL_SECURE_KEY_HERE" GITHUB_SECRET: "ANOTHER_REAL_SECURE_KEY_HERE"
- If you are missing
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.
- Run
bin/setup