Skip to content

Instantly share code, notes, and snippets.

@danielbayley
Last active May 16, 2020 00:25
Show Gist options
  • Save danielbayley/14667d9e00a7cc4e35a58dcfefbee372 to your computer and use it in GitHub Desktop.
Save danielbayley/14667d9e00a7cc4e35a58dcfefbee372 to your computer and use it in GitHub Desktop.
A shim for @rubygems to make gem install behave more like @npm.
#! /bin/zsh -f
#alias -g i=install
#RUBY_VERSION=`ruby -e 'print RUBY_VERSION'`
#export PATH=$PATH:ruby/$RUBY_VERSION/bin:$GEM_HOME/bin
gem () {
case $@ in
install*-g*) command gem install ${@:3};;
install*) command gem install ${@:2} --install-dir=ruby/$RUBY_VERSION;;
rm*) command gem uninstall $@;;
*) command gem $@;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment