Skip to content

Instantly share code, notes, and snippets.

@dwa012
Last active August 29, 2015 13:57
Show Gist options
  • Save dwa012/9489730 to your computer and use it in GitHub Desktop.
Save dwa012/9489730 to your computer and use it in GitHub Desktop.
How to create a local installation of homebrew and rvm for use on shared systems.
# change to whatever location to where homebrew is installed
if [ -z "$HOMEBREW_HOME" ]; then
export HOMEBREW_HOME=$HOME/homebrew
echo "HOMEBREW_HOME=$HOME/homebrew" >> ~/.profile
fi
# install homebrew for single user
if [ ! -d "$HOMEBREW_HOME" ]; then
mkdir -p $HOMEBREW_HOME && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C $HOMEBREW_HOME
fi
# add the new homebrew bin directory to the path
if [ -z `echo $PATH | grep "$HOMEBREW_HOME"` ]; then
echo "PATH=$HOMEBREW_HOME/bin:$PATH" >> ~/.profile
export PATH=$HOMEBREW_HOME/bin:$PATH
fi
# configure the local homebrew cache directory
if [ -z "$HOMEBREW_CACHE" ]; then
echo "HOMEBREW_CACHE=$HOME/Library/Caches/Homebrew" >> ~/.profile
export HOMEBREW_CACHE=$HOME/Library/Caches/Homebrew
fi
#########################################
## THIS WILL ISTALL CORE GNU UTILS ##
## THIS IS OPTIONAL, BUT NICE TO HAVE ##
#########################################
# install some gnu tools that are newer than the bundled BSD ones
#brew tap homebrew/dupes
#brew install grep
#brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt
#echo "PATH=$HOMEBREW_HOME/opt/coreutils/libexec/gnubin/:$PATH" >> ~/.profile
#export PATH=$HOMEBREW_HOME/opt/coreutils/libexec/gnubin/:$PATH
#########################################
#update the manpath
manpath -m $HOMEBREW_HOME/share/man
echo "manpath -m $HOMEBREW_HOME/share/man" >> ~/profile
# install rvm for single user
\curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
# install ruby 2.1.0, will take some time
rvm install 2.1.0
# install cocoapods
gem install cocoapods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment