Skip to content

Instantly share code, notes, and snippets.

@omkz
Last active April 21, 2023 11:48
Show Gist options
  • Save omkz/4e784f46193f0b5b094cd25c80a60202 to your computer and use it in GitHub Desktop.
Save omkz/4e784f46193f0b5b094cd25c80a60202 to your computer and use it in GitHub Desktop.
Setup Ruby on Rails on Ubuntu 20.04 for development machine
# zsh
sudo apt-get install zsh
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
chsh -s $(which zsh)
# rbenv
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc
#then logout and login again
# ruby
sudo apt install git curl autoconf bison build-essential \
libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \
libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
rbenv install 2.7.2
rbenv global 2.7.2
gem install rails
#nodejs
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
echo 'export NVM_DIR=~/.nvm' >> ~/.zshrc
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"' >> ~/.zshrc
source ~/.zshrc
nvm install --lts
nvm alias default node
#yarn
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 --no-install-recommends yarn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment