This work is licensed under a Creative Commons Attribution 4.0 International License.
I can only grant this license to my work, and as such, none of the images in app/assets/images are free to use, copy, or share.
- Ruby 3.0.0
- Rails 6.1.4.1
- PostgreSQL
- Open Terminal
- In the Terminal window, type the following and press Return:
xcode-select --install
- Click Install
Homebrew is a command line tool that makes it easy to install software in Mac OS. Used here to install rbenv, Ruby, and Rails.
- Go to brew.sh and copy the command, it should look something like this:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Paste the command in the terminal and press Return
- Once you follow the prompts, type:
brew doctor
If everything is working, the Terminal will print Your system is ready to brew
Visit https://gorails.com/setup/ and follow the instructions for your operating system
Remember to input Ruby 3.0.0 when typing the command as instructed
This is required for Rails version 6 to compile the frontend assets.
- macOS
brew install yarn
- Debian/Ubuntu
Then
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
For further instructions on Linux, visit the Yarn Installation Website
-
macOS
- To install postgres run the following command in the terminal. It will install the command line console (psql) as well as the local server
brew install postgresql
- To start the service and log-in to it, run:
brew services start postgresql
- If you wish to start the server automatically when you restart your computer, run:
pg_ctl -D /usr/local/var/postgres start
-
Debian/Ubuntu
- Update the package list
sudo apt-get update
- Install PostgreSQL
sudo apt-get install postgresql postgresql-contrib
- To start the server run:
pg_ctl -D /home/linuxbrew/.linuxbrew/var/postgres start
- Go into the postgres command line
psql postgres
- Here we will need to create a new user. Substitude username and password for your own. Don't forget the ; at the end.
CREATE ROLE <username> WITH LOGIN PASSWORD "<password>";
ALTER ROLE <username> CREATEDB;
- Type \du to see your new user. Quit the postgres console with \q
- Log-in as the new user to create the required databases. In the terminal, type:
psql postgres -U <username>
Then
CREATE DATABASE pinkwug;
CREATE DATABASE pinkwug_test;
- Type \list to see a list of databases. Exit the console with \q
- Open the terminal, and navigate to a folder without spaces on its name (webpacker won't work if it does) by typing cd, then dragging and dropping the folder into the console. It should copy the path.
- Run the command:
git clone https://github.com/Samuel1698/PinkWug.live.git
- Open the new folder
cd PinkWug.live
- While in the PinkWug.live folder, run these commands in the command line:
bundle install
yarn upgrade
bundle exec rails webpacker:install
rails db:reset
- You're now ready to start the server, in the command line, type:
rails s
Navigate to http://localhost:3000/