Created
October 24, 2012 20:46
-
-
Save tomkersten/3948758 to your computer and use it in GitHub Desktop.
Maintaing GEM_HOME with rbenv + omg
This file contains hidden or 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
# Trying to use http://blog.zenspider.com/blog/2012/09/ohmygems.html | |
# | |
# When I run "omg sample" and install a gem (via "gem install" or "bundle install"), it | |
# is still going into the "global" directory though. | |
# | |
# I may be doing something wrong, but, it seems like GEM_HOME is not being maintained | |
# in rbenv's shim commands. | |
# | |
# What am I doing wrong? | |
##################### | |
# Clean shell | |
##################### | |
tom/ | |
$ echo $GEM_PATH | |
tom/ | |
$ echo $GEM_HOME | |
tom/ | |
$ gem env home | |
/Users/tom/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1 | |
tom/ | |
$ gem env path | |
/Users/tom/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1:/Users/tom/.gem/ruby/1.9.1 | |
##################### | |
# Go into directory | |
##################### | |
tom/ | |
$ cd sample | |
##################### | |
# Set up omg env | |
##################### | |
sample/ | |
$ omg sample | |
Switching to sample | |
GEM_PATH=: | |
GEM_HOME=/Users/tom/.gem/repos/sample | |
PATH=/Users/tom/.rbenv/shims:/Users/tom/.rbenv/bin:/Users/tom/local/bin:/usr/local/homebrew/bin:/usr/local/pgsql/bin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/tom/.gem/repos/sample/bin | |
##################### | |
# Verify settings were...set... | |
##################### | |
sample/ | |
$ echo $GEM_HOME | |
/Users/tom/.gem/repos/sample | |
sample/ | |
$ echo $GEM_PATH | |
: # <------- NOTE: this seems wrong to me...shouldn't affect gem installation afaik | |
sample/ | |
$ rbenv which gem | |
/Users/tom/.rbenv/versions/1.9.3-p286/bin/gem | |
##################### | |
# PATH picked up by gem | |
##################### | |
sample/ | |
$ gem env path | |
/Users/tom/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1:/Users/tom/.gem/ruby/1.9.1 | |
##################### | |
# HOME picked up by gem | |
##################### | |
sample/ | |
$ gem env home | |
/Users/tom/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment