-
-
Save lachie/237477 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __init_ruby | |
set -xg ARCHFLAGS '-arch x86_64' # build gemses on Snowy | |
set -l lastruby (cat ~/.lastruby ^/dev/null) | |
if test -z $lastruby | |
set lastruby system | |
end | |
rvm $lastruby | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install gems locally, and only locally, without gem complaining | |
# about path access, and ensuring access to executables. | |
# | |
# Goes in config.fish | |
__init_ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install gems locally, and only locally, without gem complaining | |
# about path access, and ensuring access to executables. | |
# | |
# Goes in .bash_profile or .bash_login. | |
export GEM_PATH="$HOME/.gem/ruby/1.8" | |
export GEM_HOME="$HOME/.gem/ruby/1.8" | |
export PATH="$HOME/.gem/ruby/1.8/bin:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rvm | |
set -l gems '' | |
set -l ruby '' | |
if test ! $argv[1] | |
set argv[1] '<nothing>' | |
end | |
switch $argv[1] | |
case system | |
set gems $HOME/.gem-system | |
set ruby /usr/bin/ruby | |
# for other rubies add somthing like the following. | |
# the important principle is that I don't want to mix gems between versions | |
# cause its bad for space-time. | |
# case r19 | |
# set gems $HOME/.gem-1.9 | |
# set ruby ~/homebrew/.../ruby19/bin/ruby # whatever the path is | |
case '*' | |
echo 'hey, ruby needs to be one of [system]' | |
return | |
end | |
echo $argv[1] > ~/.lastruby | |
set -xg GEM_HOME $gems | |
set -xg GEM_PATH $gems | |
set -xg PATH $gems/bin (dirname $ruby) $PATH | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://ujihisa.blogspot.com/2009/06/rubygems-best-practice.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment