Skip to content

Instantly share code, notes, and snippets.

@IanVaughan
Created June 8, 2012 07:38
Show Gist options
  • Save IanVaughan/2894256 to your computer and use it in GitHub Desktop.
Save IanVaughan/2894256 to your computer and use it in GitHub Desktop.
Trying to understand rbenv gemsets

rbenv gemsets

Versions

$ rbenv
rbenv 0.3.0

$ rbenv gemset
version 0.3.0
rbenv-gemset [command] [options]

possible commands are:
  active
  create [version] [gemset]
  delete [version] [gemset]
  file
  list
  version

Rubyies

$ rbenv versions
  1.9.2-p290
  1.9.3-p0
  1.9.3-p125
  ree-1.8.7-2011.03
* ree-1.8.7-2012.01 (set by /Users/ivaughan/Projects/portal-sites/.rbenv-version)
  ree-1.8.7-2012.02

Gemsets

$ rbenv gemset list
1.9.3-p125:
  global
ree-1.8.7-2011.03:
  global
  portal-sites
ree-1.8.7-2012.01:
  global
  portal-sites
  test
  watchdog
ree-1.8.7-2012.02:
  global

Start in a projA dir

from ~/Projects/portal-sites (ree-1.8.7-2012.01)

$ cat .rbenv-gemsets
portal-sites global

$ rbenv gemset active
portal-sites global

Picking a random gem

$ gem contents subexec
/Users/ivaughan/.rbenv/versions/ree-1.8.7-2012.01/gemsets/portal-sites/gems/subexec-0.0.4/README.rdoc

Change to a diff proj

$ cd ..  # ~/Projects #=> 1.9.3-p125

Check

$ cat .rbenv-gemsets
cat: .rbenv-gemsets: No such file or directory

$ rbenv gemset active
global

$ rbenv gemset file
/Users/ivaughan/.rbenv-gemsets

$ gem contents subexec
Unable to find gem 'subexec' in default gem paths

Directories searched:
/Users/ivaughan/.rbenv/versions/1.9.3-p125/gemsets/global/specifications

Change the ruby version (shell)

$ rbenv shell ree-1.8.7-2012.01

$ gem contents subexec
Unable to find gem 'subexec' in default gem paths

Directories searched:
/Users/ivaughan/.rbenv/versions/ree-1.8.7-2012.01/gemsets/global/specifications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment