TOP

Outputs: gem env


root@server29:~# gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.3.5
  - RUBY VERSION: 3.0.2 (2021-07-07 patchlevel 107) [x86_64-linux-gnu]
  - INSTALLATION DIRECTORY: /var/lib/gems/3.0.0
  - USER INSTALLATION DIRECTORY: /root/.local/share/gem/ruby/3.0.0
  - RUBY EXECUTABLE: /usr/bin/ruby3.0
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /root/.local/share/gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-linux
  - GEM PATHS:
     - /var/lib/gems/3.0.0
     - /root/.local/share/gem/ruby/3.0.0
     - /usr/local/lib/ruby/gems/3.0.0
     - /usr/lib/ruby/gems/3.0.0
     - /usr/lib/x86_64-linux-gnu/ruby/gems/3.0.0
     - /usr/share/rubygems-integration/3.0.0
     - /usr/share/rubygems-integration/all
     - /usr/lib/x86_64-linux-gnu/rubygems-integration/3.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /usr/games
     - /usr/local/games
     - /snap/bin

gem env 的輸出提供了有關 RubyGems 環境的詳細信息,該環境管理 Ruby 庫及其依賴項。以下是每個部分的細分:

  1. RubyGems 版本

    • RUBYGEMS VERSION: 3.3.5 表示已安裝的 RubyGems 版本。該軟體用於管理 Ruby 庫或“gems”。
  2. Ruby 版本

    • RUBY VERSION: 3.0.2 指的是正在使用的 Ruby 解譯器版本。該特定版本於 2021 年 7 月發布。
  3. 安裝目錄

    • 安裝目錄:/var/lib/gems/3.0.0 是系統上安裝全域可存取的 gem 的位置。
  4. 使用者安裝目錄

    • 使用者安裝目錄:/root/.local/share/gem/ruby/3.0.0 是儲存僅為 root 使用者安裝的 gem 的位置。
  5. Ruby 執行檔

    • RUBY EXECUTABLE: /usr/bin/ruby3.0 顯示 Ruby 解釋器可執行檔案的路徑。
  6. Git 執行檔

    • GIT EXECUTABLE: /usr/bin/git 指向 Git 版本控制可執行文件,這是處理 gem 原始碼儲存庫所必需的。
  7. 可執行目錄

    • EXECUTABLE DIRECTORY: /usr/local/bin 是 RubyGems 安裝的可執行檔(例如,gems 中的命令列工具)所在的位置。
  8. 規格快取目錄

    • SPEC CACHE DIRECTORY: /root/.local/share/gem/specs 儲存已快取的 gem 的規格。
  9. 系統配置目錄

    • SYSTEM CONFIGURATION DIRECTORY: /etc 包含系統的設定文件,包括可能的 RubyGems。
  10. RubyGems 平台

    • 「RUBYGEMS PLATFORMS」顯示了gems支援的平台,其中包括「ruby」(通用Ruby)和「x86_64-linux」(64位元Linux)。
  11. 寶石路徑

    • GEM PATHS 列出了 RubyGems 將在其中尋找已安裝 gem 的所有目錄。其中包括系統範圍和使用者特定的目錄。
  12. 寶石配置

    • GEM CONFIGURATION 顯示影響 RubyGems 行為的設定。例如:
      • :update_sources = true 允許從來源自動更新。
      • :verbose = true 啟用詳細日誌記錄。
      • :backtrace = false 限制錯誤的回溯訊息。
      • :bulk_threshold = 1000 影響 gem 更新閾值。
  13. 遠端來源

    • REMOTE SOURCES 列出了 RubyGems 可以從中取得 gem 的 URL,其中 https://rubygems.org/ 為主要來源。
  14. 外殼路徑

    • SHELL PATH 顯示系統 PATH 中的目錄,在其中搜尋命令以執行。

此輸出有助於診斷和驗證伺服器上的 Ruby 和 RubyGems 環境設定。

The output from gem env gives details about the RubyGems environment, which manages Ruby libraries and their dependencies. Here’s a breakdown of each section:

  1. RubyGems Version:

    • RUBYGEMS VERSION: 3.3.5 indicates the installed RubyGems version. This software is used to manage Ruby libraries or "gems."
  2. Ruby Version:

    • RUBY VERSION: 3.0.2 refers to the Ruby interpreter version being used. This specific version was released in July 2021.
  3. Installation Directory:

    • INSTALLATION DIRECTORY: /var/lib/gems/3.0.0 is where globally accessible gems are installed on the system.
  4. User Installation Directory:

    • USER INSTALLATION DIRECTORY: /root/.local/share/gem/ruby/3.0.0 is where gems installed only for the root user are stored.
  5. Ruby Executable:

    • RUBY EXECUTABLE: /usr/bin/ruby3.0 shows the path to the Ruby interpreter executable.
  6. Git Executable:

    • GIT EXECUTABLE: /usr/bin/git points to the Git version control executable, necessary for handling gem source code repositories.
  7. Executable Directory:

    • EXECUTABLE DIRECTORY: /usr/local/bin is where executables installed by RubyGems (e.g., command-line tools from gems) are located.
  8. Spec Cache Directory:

    • SPEC CACHE DIRECTORY: /root/.local/share/gem/specs stores specifications for gems that have been cached.
  9. System Configuration Directory:

    • SYSTEM CONFIGURATION DIRECTORY: /etc contains configuration files for the system, including potentially for RubyGems.
  10. RubyGems Platforms:

    • RUBYGEMS PLATFORMS shows supported platforms for gems, which includes ruby (general Ruby) and x86_64-linux (64-bit Linux).
  11. Gem Paths:

    • GEM PATHS lists all directories where RubyGems will look for installed gems. These include system-wide and user-specific directories.
  12. Gem Configuration:

    • GEM CONFIGURATION shows settings affecting RubyGems’ behavior. For example:
      • :update_sources => true allows automatic updates from sources.
      • :verbose => true enables detailed logging.
      • :backtrace => false limits backtrace information on errors.
      • :bulk_threshold => 1000 affects gem update thresholds.
  13. Remote Sources:

    • REMOTE SOURCES lists the URLs from which RubyGems can fetch gems, with https://rubygems.org/ as the primary source.
  14. Shell Path:

    • SHELL PATH shows directories in the system’s PATH, where commands are searched for execution.

This output helps diagnose and verify the Ruby and RubyGems environment settings on the server.