To clarify, I'm using rbenv
to manage my ruby versions. I was under the impression that binaries are managed as shims
in their respective ruby version directory.
Here is what my system shows when I run gem environment (I'm excluding the irrelevant parts):
- GEM PATHS:
- /Volumes/Data/nathan/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1
- /Volumes/Data/nathan/.gem/ruby/1.9.1
Any reason for having two locations? Curious minds want to know.
By default, binaries installed by gem will be placed into: /usr/local/lib/ruby/gems/3.1.
When you use the --user-install option, RubyGems will install the gems to a directory inside your home directory, something like ~/. gem/ruby/1.9. 1 . The commands provided by the gems you installed will end up in ~/.
RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them.
Use $ gem list | grep YOURGEM to check if the YOURGEM is present.
I think I figured out the answer to this question, so I'll post it.
Rbenv allows for a global and/or local version of ruby. So once a ruby is installed and managed via rbenv, you can declare it as a global ruby version used by your entire system.
Likewise, you can declare a local ruby version within a given directory (ex: a specific rails project).
The .gem file in your home path is used by the global ruby version, where as the one tucked away in the rbenv directory is used by the local ruby version.
Note, you can (for whatever reason) declare a local version that is the same as the global version. In that case, the local version will rely on the gem files that are in the deeper rbenv directory, instead of the ~/.gem directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With