[go: nahoru, domu]

Skip to content

Instantly share code, notes, and snippets.

@ms3c
Created January 31, 2024 12:42
Show Gist options
  • Save ms3c/33334c7dbb7fd5b24af6e9f5a55597ca to your computer and use it in GitHub Desktop.
Save ms3c/33334c7dbb7fd5b24af6e9f5a55597ca to your computer and use it in GitHub Desktop.
#!/bin/bash
# Update package index
sudo apt update
# Install dependencies for Ruby
sudo apt install -y git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
# Install rbenv
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
# Add rbenv to PATH
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
# Initialize rbenv
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
# Apply changes to current shell session
source ~/.bashrc
# Verify rbenv installation
type rbenv
# Install Ruby
rbenv install 3.2.0
# Set Ruby version as global
rbenv global 3.2.0
# Verify Ruby installation
ruby -v
# Turn off local documentation generation for gems
echo "gem: --no-document" > ~/.gemrc
# Install Bundler
gem install bundler
# Display gem environment
gem env home
# Install Rails
gem install rails -v 7.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment