Skip to content

Instantly share code, notes, and snippets.

@cmthakur
Forked from geekylucas/ruby-upgrade.sh
Last active August 29, 2015 14:13
Show Gist options
  • Save cmthakur/8212db36447474ca9484 to your computer and use it in GitHub Desktop.
Save cmthakur/8212db36447474ca9484 to your computer and use it in GitHub Desktop.
#!/bin/bash -ex
# Assumes:
# homebrew
# chruby
# ruby-install
# postgres.app
# this bit might not be necessary, but can't hurt
brew upgrade ruby-install
# install the new ruby
ruby-install ruby 2.1.4
# make sure chruby can see the new ruby
source /usr/local/opt/chruby/share/chruby/chruby.sh
# make the new ruby active
chruby ruby-2.1.4
# update rubygems
gem update --system
# these gems are fequently used but often not defined in Gemfiles
gem install bundler pry omglog --no-ri --no-rdoc
# pg gem needs special flags, if we let bundler install it bad things will happen
PG_CONFIG_PATH=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
ARCHFLAGS="-arch x86_64" gem install pg --no-ri --no-rdoc -- --with-pg-config=$PG_CONFIG_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment