RubyInstaller2 Documentation

repository·master·Indexed 20 days ago

https://github.com/oneclick/rubyinstaller2

A Windows installer for Ruby 2.4 and newer that utilizes the MSYS2 toolchain and MINGW libraries to provide a build environment for gems with C-extensions. Includes the ridk utility for managing MSYS2 components, switching Ruby versions, and configuring development environments. Supports both Non-Devkit and Devkit installers, silent installation modes, and custom MSYS2 path configuration via the MSYS2_PATH environment variable.

Tokens
5.7K
Snippets
27
Records
51
Agent score
72%

What's inside RubyInstaller2

  1. Use the RubyInstaller 4.0 Startmenu

    master

    Starting with Ruby 4.0, the installer uses a console-based startmenu instead of multiple desktop icons. This startmenu provides a centralized way to launch Ruby-related tools. Improvements in version 4.0.1 include:

    • Enhanced optical and behavioral improvements.
    • Mouse event handling in the classic terminal.
    • Ability to return to the startmenu from irb and ridk sessions.
  2. Locate OpenSSL certificates via the SSL junction

    master
    In RubyInstaller-3.1.7-1 and later, a junction (directory link) is provided at <ruby>/ssl. This allows you to easily find the OpenSSL certificates directory regardless of the specific Ruby version being used. Detailed information is available in <ruby>/ssl/README-SSL.md.
  3. Locate OpenSSL certificates using the SSL junction

    master
    Starting with RubyInstaller 3.2.7, a directory junction (link) is provided at <ruby>/ssl. This allows you to easily find the OpenSSL certificates directory regardless of the specific Ruby version, as the actual location of certificates varies between versions. Detailed information about the certificates directory can be found in <ruby>/ssl/README-SSL.md.
  4. Locate bundled SSL/TLS certificates in RubyInstaller2

    master

    RubyInstaller2 includes a predefined list of trusted certificate authorities (CAs) from the Mozilla Foundation, stored in cert.pem. This file is automatically loaded when require "openssl" is executed.

    While the installer creates a junction so certificates can typically be found at <install-path>/ssl, the actual physical location depends on your Ruby version if you are using a 7z archive:

    • Ruby <= 3.1.x: ssl directory
    • Ruby >= 3.2.x and <= 3.3.x: bin/etc/ssl
    • Ruby >= 3.4.x: lib/ruby/<ruby-version>/etc/ssl

    Warning: Do not modify cert.pem manually, as it will be overwritten during RubyInstaller2 updates.

  5. Use `ridk use` to manage Ruby environments

    master

    The ridk use command allows you to select and switch between different Ruby/MSYS2 environments.

    Key features:

    • It lists both machine-wide and per-user Rubies.
    • It includes options to store environment changes permanently in the user or system environment variables.
    • It allows you to set a particular ridk/MSYS2 environment.
  6. Manage gem installation permissions in multi-user environments

    master
    In machine-wide (all-users) installations where the user may not have write access to the Ruby installation directory, RubyInstaller enables automatic private gem installation in the user's home directory. This ensures users can still install gems without requiring administrative privileges for the system-wide Ruby directory.
  7. Manage DLL paths and environment variables

    master

    RubyInstaller2 uses a specific DLL loading mechanism to avoid conflicts with the system PATH:

    • DLL Isolation: It uses a separate DLL directory and a loading mechanism that ignores the PATH environment variable for DLL lookups.
    • Custom DLL Paths: You can set the RUBY_DLL_PATH environment variable to specify additional DLL directories.
    • Encoding: You can set RUBYOPT=-Eutf-8 to force UTF-8 encoding via environment variables.
  8. Locate OpenSSL certificates via the `<ruby>/ssl` junction

    master
    Starting with version RubyInstaller-3.3.7-1, a junction (directory link) is created at <ruby>/ssl. This allows you to easily find the OpenSSL certificates directory regardless of which specific subdirectory the certificates are stored in for a given Ruby version. Detailed information about the certificates can be found in <ruby>/ssl/README-SSL.md.
  9. Configure UTF-8 encoding in RubyInstaller2

    master

    RubyInstaller2 provides mechanisms to ensure proper UTF-8 handling:

    • Default Behavior: In version 2.4.10-1 and later, UTF-8 encoding is enabled by default for new installations.
    • IRB History: For version 2.4.10-1 and later, IRB history is automatically rewritten to UTF-8 upon the first start of irb.
    • Installer Option: During installation, you can choose an option to set the environment variable RUBYOPT=-Eutf-8, which sets Encoding.default_external to UTF-8.
  10. Install RDoc and RI documentation as an optional component

    master
    During installation, you can choose to install RDoc-based RI documentation as an optional component. This is separate from the standard HTML documentation, which is also an optional install component named "Ruby RI and HTML documentation".
  11. Upgrade to RubyInstaller 4.0.x

    master

    RubyInstaller 4.0.0 and later versions are based on the Ruby 4.0.x series. When upgrading from the 3.4.x series to 4.0.x, note the following breaking changes:

    • Architecture Support: X86/32-bit release packages are no longer provided. Only X64 and ARM64 packages are available for Ruby 4.0+.
    • UI Changes: The multiple app icons from previous versions have been replaced by a single icon and a console-based startmenu (required for Microsoft Store compatibility).
    • CLI Improvements: Includes a patch to ensure the Ruby CLI recognizes inputs as UTF-8.