Search code examples
rubyrubygemsrbenv

Installing gems to which Ruby with rbenv


How does one control which Ruby a gem is installed to using rbenv? Or could there be a central place accessible to all Rubies? I am just running Ruby scripts not Rails. rbenv-gemset seems to be for that?


Solution

  • The gem is installed into whatever your currently selected Ruby is. E.g.

    rbenv shell 2.0.0-p247
    gem install bundler  # bundler is installed for Ruby 2.0.0-p247 only
    rbenv shell 1.9.3-p447
    gem install bundler  # bundler is installed for Ruby 1.9.3-p447 only