This repository has been archived on 2022-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
prezto/plugins/ruby/init.zsh

40 lines
1008 B
Bash
Raw Normal View History

# Install local gems according to Mac OS X conventions.
if [[ "$OSTYPE" == darwin* ]]; then
export GEM_HOME=$HOME/Library/Ruby/Gems/1.8
export PATH=$GEM_HOME/bin:$PATH
# gem is slow; cache its output.
cache_file="${0:h}/cache.zsh"
if [[ ! -f "$cache_file" ]]; then
echo export GEM_PATH=$GEM_HOME:$(gem env gempath) >! "$cache_file"
source "$cache_file"
else
source "$cache_file"
fi
unset cache_file
fi
2011-08-30 23:16:15 -04:00
# Loads RVM into the shell session.
if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
# Auto adding variable-stored paths to ~ list conflicts with RVM.
unsetopt auto_name_dirs
# Source RVM.
source "$HOME/.rvm/scripts/rvm"
fi
# Loads rbenv into the shell session.
if [[ -s "$HOME/.rbenv/bin/rbenv" ]]; then
path=("$HOME/.rbenv/bin" $path)
eval "$(rbenv init -)"
fi
# Set environment variables for launchd processes.
if [[ "$OSTYPE" == darwin* ]]; then
for env_var in GEM_PATH GEM_HOME; do
launchctl setenv "$env_var" "${(P)env_var}" &!
done
unset env_var
fi