確認方法
次のコマンドを実行することでGemのインストール先を確認できます。
gem environment gemdir
$ gem environment gemdir
/usr/local/bundle
gemdir
を除いて実行すると以下のような情報が出力される。
$ RubyGems Environment:
- RUBYGEMS VERSION: 3.3.26
- RUBY VERSION: 3.1.3 (2022-11-24 patchlevel 185) [aarch64-linux]
- INSTALLATION DIRECTORY: /usr/local/bundle
- USER INSTALLATION DIRECTORY: /home/ruby/.local/share/gem/ruby/3.1.0
- RUBY EXECUTABLE: /usr/local/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /usr/local/bundle/bin
- SPEC CACHE DIRECTORY: /home/ruby/.local/share/gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
- RUBYGEMS PLATFORMS:
- ruby
- aarch64-linux
- GEM PATHS:
- /usr/local/bundle
- /home/ruby/.local/share/gem/ruby/3.1.0
- /usr/local/lib/ruby/gems/3.1.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => true
- :bulk_threshold => 1000
- "install" => "--no-document"
- "update" => "--no-document"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bundle/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin