Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find where gem files are installed

Tags:

ruby

rubygems

I can finds gems that are installed using gem list, but it doesn't show me where the gems are installed.

How can I find where the gems are, and how can I know before installing a gem where it will be installed?

like image 404
ironsand Avatar asked Sep 28 '13 21:09

ironsand


People also ask

How do you check if a gem is installed?

Since your goal is to verify a gem is installed with the correct version, use gem list . You can limit to the specific gem by using gem list data_mapper . To verify that it's installed and working, you'll have to try to require the gem and then use it in your code.

Where does ASDF install gems?

A feature of the asdf-ruby plugin is that it can install a set of default gems specified in a ~/. default-gems file.


1 Answers

Use gem environment to find out about your gem environment:

RubyGems Environment:   - RUBYGEMS VERSION: 2.1.5   - RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin12.4.0]   - INSTALLATION DIRECTORY: /Users/ttm/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0   - RUBY EXECUTABLE: /Users/ttm/.rbenv/versions/2.0.0-p247/bin/ruby   - EXECUTABLE DIRECTORY: /Users/ttm/.rbenv/versions/2.0.0-p247/bin   - SPEC CACHE DIRECTORY: /Users/ttm/.gem/specs   - RUBYGEMS PLATFORMS:     - ruby     - x86_64-darwin-12   - GEM PATHS:      - /Users/ttm/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0      - /Users/ttm/.gem/ruby/2.0.0   - GEM CONFIGURATION:      - :update_sources => true      - :verbose => true      - :backtrace => false      - :bulk_threshold => 1000   - REMOTE SOURCES:      - https://rubygems.org/   - SHELL PATH:      - /Users/ttm/.rbenv/versions/2.0.0-p247/bin      - /Users/ttm/.rbenv/libexec      - /Users/ttm/.rbenv/plugins/ruby-build/bin      - /Users/ttm/perl5/perlbrew/bin      - /Users/ttm/perl5/perlbrew/perls/perl-5.18.1/bin      - /Users/ttm/.pyenv/shims      - /Users/ttm/.pyenv/bin      - /Users/ttm/.rbenv/shims      - /Users/ttm/.rbenv/bin      - /Users/ttm/bin      - /usr/local/mysql-5.6.12-osx10.7-x86_64/bin      - /Users/ttm/libsmi/bin      - /usr/local/bin      - /usr/bin      - /bin      - /usr/sbin      - /sbin      - /usr/local/bin 

Notice the two sections for:

  • INSTALLATION DIRECTORY
  • GEM PATHS
like image 191
the Tin Man Avatar answered Sep 28 '22 15:09

the Tin Man