Skip to content

Instantly share code, notes, and snippets.

@defaye
Last active July 12, 2021 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save defaye/dd36d611329791c00c883337975db319 to your computer and use it in GitHub Desktop.
Save defaye/dd36d611329791c00c883337975db319 to your computer and use it in GitHub Desktop.
Install Ruby on Rails with rbenv on Ubuntu 18.04
sudo apt update && sudo apt install -y git-all \
autoconf \
bison \
build-essential \
libssl-dev \
libyaml-dev \
libreadline6-dev \
zlib1g-dev \
libncurses5-dev \
libffi-dev \
libgdbm5 \
libgdbm-dev
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.$(echo $SHELL | grep -o '[^/]*$')rc
echo 'eval "$(rbenv init -)"' >> ~/.$(echo $SHELL | grep -o '[^/]*$')rc
source ~/.$(echo $SHELL | grep -o '[^/]*$')rc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.7
rbenv global 2.7
echo "gem: --no-document" > ~/.gemrc
gem install bundler
gem install rails
rbenv rehash
@defaye
Copy link
Author

defaye commented Jun 2, 2020

To run this command in one line:

curl -s https://gist.github.com/defaye/dd36d611329791c00c883337975db319/raw/2e062559f9c09e97689c830be73aaf0ddb802083/install_ruby_on_rails.sh | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment