rad~$

Platform Compatibility

Rad provides robust cross-platform compatibility with powerful platform management features to ensure your gems work correctly across different environments.

Supported Platforms

Rad officially supports the following platforms:

Operating Systems

  • macOS (10.13+)
  • Linux (glibc and musl)
  • Windows (10+)
  • FreeBSD

Architectures

  • x86_64 (Intel/AMD 64-bit)
  • aarch64 / arm64 (Apple Silicon)
  • i686 (Intel/AMD 32-bit)
  • armv7 (32-bit ARM)

Ruby Implementations

  • MRI Ruby (2.0.0+)
  • JRuby (9.0+)
  • TruffleRuby

Ruby Managers

  • RVM
  • rbenv
  • asdf
  • chruby

Managing Platform-Specific Dependencies

Rad automatically handles platform-specific dependencies in your Gemfile. You can specify platform requirements using the platform option:

terminal
# Example Gemfile with platform-specific dependencies
source 'https://rubygems.org'
# Gems for all platforms
gem 'rails', '~> 7.1.0'
# Platform-specific gems
gem 'sqlite3', platforms: [:ruby, :mswin, :mingw]
gem 'pg', platforms: :ruby
# OS-specific gems
gem 'wdm', '>= 0.1.0', platforms: [:mingw, :mswin, :x64_mingw]
gem 'win32-process', platforms: [:mingw, :mswin, :x64_mingw]
# Ruby implementation specific gems
gem 'jruby-openssl', platforms: :jruby

Platform Commands

Rad provides commands to help you manage and verify platform compatibility:

Listing Available Platforms

terminal
rad platform list
Available Platforms:
- ruby
- mswin
- mingw
- x64_mingw
- jruby
- x86_64-darwin
- arm64-darwin
- x86_64-linux
- aarch64-linux
- x86_64-linux-musl

Checking Platform Compatibility

terminal
rad check --platform arm64-darwin
Checking gem compatibility for platform arm64-darwin...
✓ sqlite3 (1.6.3) is compatible with arm64-darwin
✓ rails (7.1.0) is compatible with arm64-darwin
✓ puma (6.3.0) is compatible with arm64-darwin
...
All 38 gems are compatible with platform arm64-darwin.

Installing for Specific Platform

terminal
rad install --platform x86_64-linux
Fetching gem metadata from https://rubygems.org/...
Resolving dependencies...
Installing rake 13.0.6
Installing concurrent-ruby 1.2.2
...
Using rails 7.1.0
Platform-specific gems for x86_64-linux have been installed.
Total installation time: 0.92 seconds

Cross-Platform Compilation

When native extensions are required, Rad provides efficient handling of platform-specific gems:

To build gems for Linux while on macOS:

terminal
rad add nokogiri --platform x86_64-linux
Adding nokogiri for platform x86_64-linux...
Using Docker for cross-compilation (requires Docker to be running)
Building native extensions for x86_64-linux
Successfully installed nokogiri-1.15.4-x86_64-linux
1 gem installed
Cross-compilation to Linux from macOS requires Docker to be installed and running.

Platform Detection

Rad automatically detects your current platform, but you can also specify the target platform in configuration:

terminal
# .rad/config.toml
[platforms]
# Always include these platforms in the lockfile
required = ["arm64-darwin", "x86_64-linux"]
# Default target platform for installation if not specified
default = "ruby"
# Enable cross-compilation
cross_compile = true

Multi-Platform Lockfiles

Rad automatically creates multi-platform lockfiles that ensure consistent dependencies across different environments. This is especially useful for projects that need to run on multiple operating systems or CI/CD pipelines.

terminal
rad lock --add-platform x86_64-linux
Adding platform x86_64-linux to the lockfile...
Resolving dependencies for added platform...
Updated Gemfile.rad with new platform.

Bundler Compatibility

Rad's lockfiles are compatible with Bundler, allowing seamless transitions between Rad and Bundler in multi-developer environments.

Next Steps

To learn more about platform-specific dependency management:

GitHub