简体   繁体   中英

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?

The gem is installed into whatever your currently selected Ruby is. Eg

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

Just to add on: rbenv-gemset would be for organizing your gems within the same ruby version . Only rbenv controls which ruby you install your gems to...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM