Skip to content

Instantly share code, notes, and snippets.

@muhammadyana
Last active June 28, 2022 10:45
Show Gist options
  • Save muhammadyana/0362236db9d9a885e053df3821a07eff to your computer and use it in GitHub Desktop.
Save muhammadyana/0362236db9d9a885e053df3821a07eff to your computer and use it in GitHub Desktop.
Setup ruby on rails and required in ubuntu

INSTALL ZSH

sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc

AUTO SUGGESTION

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
plugins=(git zsh-autosuggestions rails rvm ruby)
sudo apt-get install zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev imagemagick libmagickwand-dev software-properties-common
or
sudo yum install zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

INSTALL REDIS

sudo apt update && sudo apt install redis-server
sudo nano /etc/redis/redis.conf

# Change supervised to systemd
supervised systemd
sudo systemctl restart redis.service

INSTALL RVM

sudo apt-get install gnupg2 -y
#gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
\curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm requirements
nano ~/.gemrc
gem: --no-document

INSTALL POSTGRE

sudo apt update && sudo apt install postgresql postgresql-contrib
sudo apt-get install libpq-dev

CREATE USER

sudo -i -u postgres
createuser --interactive
\password deploy

ADD USER DEPLOY

adduser deploy
usermod -aG sudo deploy

INSTALL NGINX

sudo apt update && sudo apt install nginx

sudo ufw app list
sudo ufw allow 'Nginx HTTP'
sudo ufw status

INSTALL MINIMAGICK

sudo apt-get update -y
sudo apt-get install -y ruby-mini-magick

INSTALL NODE JS & YARN

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment