Skip to content

Instantly share code, notes, and snippets.

@dannysmith
Created July 9, 2016 20:13
Show Gist options
  • Select an option

  • Save dannysmith/e788e545ddfff72c1a7141730f8cdfd7 to your computer and use it in GitHub Desktop.

Select an option

Save dannysmith/e788e545ddfff72c1a7141730f8cdfd7 to your computer and use it in GitHub Desktop.
# Install Ruby
find_latest_ruby() {
rbenv install -l | grep -v - | tail -1 | sed -e 's/^ *//'
}
ruby_version="$(find_latest_ruby)"
fancy_echo "Installing and Configuring rbenv and ruby..."
# append_to_zshrc 'eval "$(rbenv init - --no-rehash)"' 1
eval "$(rbenv init -)"
# Set Default rubygems to include in all ruby installations via rbenv
fancy_echo "Setting default gems..."
cat > "$HOME/.rbenv/default-gems" <<-EOF
bundler
brice
gist
pry
pry-doc
awesome_print
specific_install
EOF
if ! rbenv versions | grep -Fq "$ruby_version"; then
fancy_echo "Installing ruby $ruby_version..."
RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/opt/openssl rbenv install -s "$ruby_version"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment