# Install ruby with Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, scoop, zypper

Powerful, clean, object-oriented scripting language. Version 4.0.5 via Homebrew; verified 2026-07-03.

## Install

```sh
sudo av install brew:ruby
```

## Agent safety answer

ruby runs project tooling, package builds, and scripts that often sit near credentials.

- **Credential access:** Reads environment variables, bundle config, gem credentials, and app secrets.
- **Remote mutation:** Can run deploy scripts, API clients, and database tasks.
- **Publish/artifact risk:** Can build or publish gems and generated application artifacts.
- **Recommended control:** Gate gem publish, deploy tasks, and script execution with injected secrets.
- **Agent-use guidance:** Allow local tests; require approval for publishing, deploy commands, and secret-backed tasks.

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install ruby
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ruby
```

  Evidence: MacPorts ports tree: lang/ruby/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add ruby
```

  Evidence: Alpine Linux edge package indexes: ruby from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install ruby
```

  Evidence: Debian stable package indexes: ruby from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install ruby
```

  Evidence: Fedora Rawhide package metadata: ruby from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#ruby
```

  Evidence: nixpkgs package indexes: ruby from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S ruby
```

  Evidence: Arch Linux sync databases: ruby from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install ruby
```

  Evidence: openSUSE Tumbleweed package metadata: ruby from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install ruby
```

  Evidence: Chocolatey community package catalog: ruby from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='11','reportgenerator.portable'

- Scoop (92%):

```sh
scoop install main/ruby
```

  Evidence: Scoop official bucket manifest trees: bucket/ruby.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:ruby
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/ruby>
- **Version:** 4.0.5
- **Source summary:** Powerful, clean, object-oriented scripting language
- **Homepage:** <https://www.ruby-lang.org/>
- **Repository:** <https://github.com/ruby/ruby>
- **Upstream docs:** <https://docs.ruby-lang.org/en>
- **License:** Ruby
- **Source archive:** <https://cache.ruby-lang.org/pub/ruby/4.0/ruby-4.0.5.tar.gz>
- **Last updated:** 2026-07-03T00:24:54-04:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- bundle (cli)
- bundler (cli)
- erb (cli)
- gem (cli)
- irb (cli)
- minitest (cli)
- racc (cli)
- rake (cli)
- rbs (cli)
- rdbg (cli)
- rdoc (cli)
- ri (cli)
- ruby (cli)
- syntax_suggest (cli)
- test-unit (cli)
- typeprof (cli)
- bundle (alias)
- bundler (alias)
- erb (alias)
- gem (alias)
- irb (alias)
- minitest (alias)
- racc (alias)
- rake (alias)
- rbs (alias)
- rdbg (alias)
- rdoc (alias)
- ri (alias)
- ruby (alias)
- syntax_suggest (alias)
- test-unit (alias)
- typeprof (alias)

## Dependencies

- libyaml
- openssl@3

## Build dependencies

- pkgconf
- rust

## Uses from macOS

- libffi
- libxcrypt

## Install behavior

- Post-install hook: defined
- Caveats: By default, binaries installed by gem will be placed into: $HOMEBREW_PREFIX/lib/ruby/gems/4.0.0/bin You may want to add this to your PATH.
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 4.0.5
- Package-manager updated: 2026-07-03
- Local data: ok
- Upstream repository: https://www.ruby-lang.org/
- info: Release/tag comparison is only available for GitHub repositories.

## Security Notes

doc example: interpreter runtime.

- **Geiger risk:** yellow / high
- doc example: interpreter runtime


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Credential files

- Unix: ~/.gem/credentials
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** ruby
- **Aliases:** ruby@4, ruby@4.0
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - ruby - 1:3.3+b1: normalized package name match | Debian stable package indexes: ruby from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Interpreter of object-oriented scripting language Ruby (default version) | https://www.ruby-lang.org/
- Nix - ruby: normalized package name match | nixpkgs package indexes: ruby from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - ruby - 1:3.2~ubuntu1: normalized package name match | Ubuntu 24.04 LTS package indexes: ruby from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz | Interpreter of object-oriented scripting language Ruby (default version) | https://www.ruby-lang.org/
- apk - ruby - 3.4.9-r0: normalized package name match | Alpine Linux edge package indexes: ruby from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | An object-oriented language for quick and easy programming | https://www.ruby-lang.org/
- apk - ruby-dbg - 3.4.9-r0: normalized package name match | Alpine Linux edge package indexes: ruby-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | An object-oriented language for quick and easy programming (debug symbols) | https://www.ruby-lang.org/
- apk - ruby-dev - 3.4.9-r0: normalized package name match | Alpine Linux edge package indexes: ruby-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | An object-oriented language for quick and easy programming (development files) | https://www.ruby-lang.org/
- apk - ruby-doc - 3.4.9-r0: normalized package name match | Alpine Linux edge package indexes: ruby-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | An object-oriented language for quick and easy programming (documentation) | https://www.ruby-lang.org/
- apk - ruby-full - 3.4.9-r0: normalized package name match | Alpine Linux edge package indexes: ruby-full from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Ruby with all bundled gems | https://www.ruby-lang.org/
- apk - ruby-libs - 3.4.9-r0: normalized package name match | Alpine Linux edge package indexes: ruby-libs from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Libraries necessary to run Ruby | https://www.ruby-lang.org/
- apk - ruby-rdoc - 3.4.9-r0: normalized package name match | Alpine Linux edge package indexes: ruby-rdoc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | Ruby documentation tool | https://www.ruby-lang.org/
- dnf - ruby - 4.0.5-33.fc45: normalized package name match | Fedora Rawhide package metadata: ruby from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | An interpreter of object-oriented scripting language | https://www.ruby-lang.org/
- dnf - ruby-bundled-gems - 4.0.5-33.fc45: normalized package name match | Fedora Rawhide package metadata: ruby-bundled-gems from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Bundled gems which are part of Ruby StdLib | https://www.ruby-lang.org/
- dnf - ruby-default-gems - 4.0.5-33.fc45: normalized package name match | Fedora Rawhide package metadata: ruby-default-gems from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Default gems which are part of Ruby StdLib | https://www.ruby-lang.org/
- dnf - ruby-devel - 4.0.5-33.fc45: normalized package name match | Fedora Rawhide package metadata: ruby-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | A Ruby development environment | https://www.ruby-lang.org/
- dnf - ruby-doc - 4.0.5-33.fc45: normalized package name match | Fedora Rawhide package metadata: ruby-doc from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Documentation for ruby | https://www.ruby-lang.org/
- dnf - ruby-libs - 4.0.5-33.fc45: normalized package name match | Fedora Rawhide package metadata: ruby-libs from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst | Libraries necessary to run Ruby | https://www.ruby-lang.org/


## Related links

- [Package publisher tools](https://www.automicvault.com/pkg/package-publishers/) - Belongs to a package publishing or registry command family.
- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [openssl@3](https://www.automicvault.com/pkg/brew/openssl-3/) - Runtime dependency declared by Homebrew.
- [pkgconf](https://www.automicvault.com/pkg/brew/pkgconf/) - Build dependency declared by Homebrew.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [asciidoctor](https://www.automicvault.com/pkg/brew/asciidoctor/) - Popular package that depends on this formula.
- [braid](https://www.automicvault.com/pkg/brew/braid/) - Popular package that depends on this formula.
- [cdxgen](https://www.automicvault.com/pkg/brew/cdxgen/) - Popular package that depends on this formula.
- [classifier](https://www.automicvault.com/pkg/brew/classifier/) - Popular package that depends on this formula.
- [cocoapods](https://www.automicvault.com/pkg/brew/cocoapods/) - Popular package that depends on this formula.
- [cucumber-ruby](https://www.automicvault.com/pkg/brew/cucumber-ruby/) - Popular package that depends on this formula.
- [dexter](https://www.automicvault.com/pkg/brew/dexter/) - Popular package that depends on this formula.
- [dory](https://www.automicvault.com/pkg/brew/dory/) - Popular package that depends on this formula.
- [ruby@3.2](https://www.automicvault.com/pkg/brew/ruby-3-2/) - Package name indicates the same formula family.
- [ruby@3.3](https://www.automicvault.com/pkg/brew/ruby-3-3/) - Package name indicates the same formula family.
- [ruby@3.4](https://www.automicvault.com/pkg/brew/ruby-3-4/) - Package name indicates the same formula family.
- [portable-ruby](https://www.automicvault.com/pkg/brew/portable-ruby/) - Shares the same upstream homepage.
- [gnu-apl](https://www.automicvault.com/pkg/brew/gnu-apl/) - Shares av.db curated category or tags: cli, interpreter, language-runtime, programming-language, scripting.
- [lua](https://www.automicvault.com/pkg/brew/lua/) - Shares av.db curated category or tags: cli, interpreter, language-runtime, programming-language, scripting.
- [picat](https://www.automicvault.com/pkg/brew/picat/) - Shares av.db curated category or tags: cli, interpreter, language-runtime, programming-language, scripting.
- [algol68g](https://www.automicvault.com/pkg/brew/algol68g/) - Shares av.db curated category or tags: cli, interpreter, language-runtime, programming-language.
- [gosu](https://www.automicvault.com/pkg/brew/gosu/) - Shares av.db curated category or tags: cli, language-runtime, programming-language, scripting.
- [gravity](https://www.automicvault.com/pkg/brew/gravity/) - Shares av.db curated category or tags: cli, interpreter, language-runtime, programming-language.

## Combined YAML source

View the package source record on GitHub. [combined/ruby.yml](https://github.com/automic-vault/db/blob/main/combined/ruby.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
- curated agent safety answer
