### Perform Silent RubyInstaller Installation Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Examples of using command-line flags to automate the RubyInstaller installation process. ```sh c:\>rubyinstaller.exe /silent /dir="e:/my_test_ruby" c:\>rubyinstaller.exe /verysilent /allusers /tasks=assocfiles,nomodpath ``` -------------------------------- ### Initialize a Rails Application Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Standard commands to install Rails, create a new project, generate a scaffold, and start the server. ```sh gem install rails rails new myapp cd myapp rails g scaffold cats name:string rails db:migrate rails s ``` -------------------------------- ### Install Bundler and Dependencies Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Install the `bundler` gem and then install application-specific gems using `bundle install`. This is recommended for updating Ruby installations. ```sh gem install bundler cd your-application bundle install ``` -------------------------------- ### Install Ruby using winget Source: https://github.com/oneclick/rubyinstaller2/wiki/Microsoft-|-Store Use this command to install Ruby if the Microsoft Store installation fails. It provides more detailed progress and error messages. ```bash winget install "Ruby 4.0" --force ``` -------------------------------- ### Install sqlite3 Gem with Dependencies Source: https://github.com/oneclick/rubyinstaller2/blob/master/README.md Installs the `sqlite3` gem by first installing its MSYS2 dependency using `pacman` and then installing the gem. ```sh ridk exec pacman -S mingw-w64-x86_64-sqlite3 gem install sqlite3 --platform ruby ``` -------------------------------- ### Unattended MSYS2 Installation Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ After an unattended MSYS2 installation, execute this command to complete the setup and enable `pacman`. ```bash /bin/ridk install 1 ``` -------------------------------- ### Install nokogiri Gem with Dependencies Source: https://github.com/oneclick/rubyinstaller2/blob/master/README.md Installs the `nokogiri` gem by first installing its MSYS2 dependency (`libxslt`) using `pacman` and then installing the gem with system library support. ```sh ridk exec pacman -S mingw-w64-x86_64-libxslt gem install nokogiri --platform ruby -- --use-system-libraries ``` -------------------------------- ### Example RubyInstaller Build Target Source: https://github.com/oneclick/rubyinstaller2/blob/master/README.md An example of a specific Rake build target for creating a 7z archive of the RubyInstaller with MSYS2 Devkit for Ruby 3.4.1 on x86 architecture. ```shell rake ri:ruby-3.4.1-x86-msvcrt:archive-7z ``` -------------------------------- ### Clone RubyInstaller2 and Install Dependencies Source: https://github.com/oneclick/rubyinstaller2/blob/master/README.md Clone the RubyInstaller2 repository and install its Ruby dependencies using Bundler. This is a prerequisite for running build tasks. ```shell git clone https://github.com/oneclick/rubyinstaller2 cd rubyinstaller2 bundle install ``` -------------------------------- ### Set Inno-Setup Path Source: https://github.com/oneclick/rubyinstaller2/blob/master/README.md Add the Inno-Setup compiler executable to your system's PATH environment variable. Ensure the path to 'iscc.exe' is correct for your installation. ```shell set PATH=%PATH%;"c:\Program Files (x86)\Inno Setup 6" ``` -------------------------------- ### Launch Certum Java Applet Source: https://github.com/oneclick/rubyinstaller2/wiki/CertumCodeSigning Starts the Certum certificate activation applet using the downloaded JNLP file. Ensure OpenJDK-8 and PCSC are correctly set up. ```bash javaws ~/Downloads/CertumCryptoAgent_en.jnlp ``` -------------------------------- ### Install Signing Dependencies on Ubuntu Source: https://github.com/oneclick/rubyinstaller2/wiki/CertumCodeSigning Installs necessary packages including OpenJDK-8, PCSC, and smart card reader drivers. It also sets the default Java version to OpenJDK-8. ```bash sudo apt install openjdk-8-jdk icedtea-netx libpcsclite-dev pcscd libacsccid1 sudo rm /usr/lib/jvm/default-java sudo ln -sf /usr/lib/jvm/java-8-openjdk-amd64 /usr/lib/jvm/default-java ``` -------------------------------- ### Silent Ruby Installation Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Perform a very silent installation to a custom directory for the current user, excluding file associations, PATH updates, and RIDK installation. ```bash c:\>rubyinstaller.exe /verysilent /currentuser /dir="d:/rubyABC" /tasks="noassocfiles,nomodpath,noridkinstall" ``` -------------------------------- ### Set PATH for Portable Ruby Installation Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Use this command in a Windows command prompt to add the Ruby bin directory to your system's PATH for portable installations. This allows you to run Ruby executables from any location. ```batch SET PATH=f:/portable/ruby/bin;%PATH% ruby -v ``` -------------------------------- ### Install Yarn via MSYS2 Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Use the ridk tool to install Yarn within the MSYS2 environment for Rails compatibility. ```sh ridk exec pacman -S %MINGW_PACKAGE_PREFIX%-yarn ``` -------------------------------- ### Move Ruby Installation Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Steps to uninstall Ruby partially, move the directory, and then reinstall Ruby into the new location. ```bash c:\Ruby\unins000.exe /allfiles=no ``` -------------------------------- ### Sign RubyInstaller executables Source: https://github.com/oneclick/rubyinstaller2/wiki/Maintainers'-corner Sign all downloaded .exe files using osslsigncode. This process re-signs with GPG and updates SHA256 hash values. Ensure osslsigncode is installed. ```bash rake release:sign ``` -------------------------------- ### Uninstall Ruby Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Execute the uninstaller executable found in the Ruby installation directory to remove Ruby, MSYS2, and installed gems. ```bash c:\Ruby\unins000.exe /SILENT /allfiles=yes ``` -------------------------------- ### Enable MSYS2 and MINGW Tools Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Run this command in a Windows command prompt or PowerShell to enable MSYS2 and MINGW tools for use with your Ruby installation. This is necessary for certain development tasks. ```batch ridk enable ``` -------------------------------- ### Uninstall Ruby (Keep MSYS2 and Gems) Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Use this command to uninstall only Ruby files, preserving MSYS2 and installed gems. ```bash c:\Ruby\unins000.exe /SILENT /allfiles=no ``` -------------------------------- ### Verify PGP Signature of Download Files Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ These commands are executed within an MSYS2 shell to import the signing key and verify the PGP signature of a downloaded RubyInstaller executable. Ensure you have `curl` and `gpg` installed. ```sh $ ridk exec sh -l $ cd c:/Users/$USER/Downloads $ curl https://rubyinstaller.org/ci.ri2-package-signing-key.asc | gpg --import $ gpg --verify rubyinstaller-3.0.0-1-x64.exe.asc ``` -------------------------------- ### Configure Bundler for Source Gems Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Forces Bundler to install gems from source, which may be necessary if binary gems are unavailable for the current Ruby version. ```sh bundle config force_ruby_platform true ``` -------------------------------- ### Verify MSYS2-Devkit location Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ Use the ridk tool to confirm which MSYS2 path is currently associated with a specific Ruby installation. ```bash $ c:\Ruby26-x64\bin\ridk version [...] msys2: path: C:\msys64 ``` -------------------------------- ### Alternative Successful PGP Signature Verification Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ This is an alternative example of the output you might see after successfully verifying a PGP signature, indicating a good signature from a different key. ```sh gpg: using RSA key B5FF9149F95A59BFBCFDAF0543B526B8AAE32BA7 gpg: Good signature from "Lars Kanis " [unknown] ``` -------------------------------- ### Successful PGP Signature Verification Source: https://github.com/oneclick/rubyinstaller2/wiki/FAQ This is an example of the output you should see in an MSYS2 shell after successfully verifying a PGP signature. It confirms the integrity and authenticity of the downloaded file. ```sh gpg: Signature made Sun Dec 27 21:45:05 2020 CET gpg: using RSA key A2A9BAD21B8D41522FE07214E11AE6CF30B77F3A gpg: Good signature from "ci.ri2 package signing key" [full] ``` -------------------------------- ### Display ridk use help Source: https://github.com/oneclick/rubyinstaller2/wiki/The-ridk-tool Shows usage and options for the ridk use sub-command, which manages Ruby version switching. ```text Usage: ridk use [