# 使用 Homebrew 安装 opal

查看 opal 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:opal
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install opal
```

  证据: local Homebrew formula metadata

## 软件包事实

- **软件包键:** brew:opal
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/opal>
- **版本:** 1.8.3
- **来源摘要:** Ruby to JavaScript transpiler
- **主页:** <https://opalrb.com/>
- **仓库:** <https://github.com/opal/opal>
- **上游文档:** <https://opalrb.com/>
- **许可证:** MIT
- **源码归档:** <https://github.com/opal/opal.git>
- **最后更新:** 2026-06-22T14:05:41-07:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- opal (cli)
- opal-build (cli)
- opal-repl (cli)
- opal (别名)
- opal-build (别名)
- opal-repl (别名)

## 依赖

- ruby

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.8.3
- 管理器更新时间: 2026-06-22
- 本地数据: OK
- 上游仓库: https://github.com/opal/opal
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

Opal is a Ruby-to-JavaScript source-to-source compiler with a Ruby core library and standard-library subset implemented for JavaScript runtimes. It sits in the compile-to-JavaScript lineage, but its package-nerd identity is unusually Ruby-centric: developers install it as a Ruby gem, write Ruby, and emit JavaScript for browsers, Node.js, and other JavaScript environments.

### 项目历史

RubyGems records Opal versions back to January 22, 2010, and the project reached the 1.0.0 milestone on May 12, 2019 after years of production use and compatibility work. The 1.0 release emphasized a redesigned class and module hierarchy that more closely followed MRI Ruby, support for Module.prepend, better source maps, improved errors, and broader Ruby 2.4/2.5 feature coverage.

Later 1.x releases continued the same theme: Opal 1.2 described the project as a Ruby compiler, runtime, and idiomatic Ruby API for Browser, Node, and other JavaScript environments, and announced near-complete Ruby 3.0 feature support. Opal 1.6 focused on MRI compatibility, freezing, control-flow correctness, Windows improvements, parallel compilation, and Opal-RSpec 1.0.

### 采用历史

Opal's adoption path has been through Ruby's packaging and web-application ecosystem rather than through npm-first JavaScript tooling. Its official site links Rack, Rails, CLI, and library guides, and the README points developers toward Rails, jQuery, Sinatra, Rack, CDN, and related usage patterns.

The project has been distributed as the opal RubyGem for more than a decade, with RubyGems listing more than one hundred published versions. That long gem history is important for packagers because it shows Opal evolving as a Ruby ecosystem package while targeting JavaScript as the runtime artifact.

### 使用方式

Developers use the opal CLI to compile Ruby source into JavaScript, or use Opal.compile and Opal::Builder from Ruby code to generate runtime bundles and applications. The README also documents browser-side use through opal-parser and script tags that evaluate Ruby code inside an HTML page.

The package is useful when a team wants Ruby syntax, Ruby libraries that can run under Opal's compatibility subset, or Ruby DSLs on the front end without switching entirely to JavaScript. The tradeoff is that compatibility with MRI Ruby is an ongoing engineering project, so users often care about the exact Opal version and supported Ruby feature set.

### 为什么软件包爱好者会关心

Opal is a tidy example of a language package whose install surface and target runtime are different ecosystems. For package nerds, it raises familiar questions about transitive Ruby dependencies, generated JavaScript artifacts, CDN distribution, source maps, browser support, and compatibility claims across Ruby and JavaScript versions.

Its executables, opal, opal-build, and opal-repl, make it feel like a compiler toolchain inside Homebrew even though many users encounter it first as a gem. That dual identity is the interesting bit: package managers expose it as a CLI, while application developers often treat it as a build-stage bridge.

### 时间线

- 2010: RubyGems lists the first opal gem versions.
- 2013: the GitHub project license notice covers Adam Beynon and Opal contributors from 2013 onward.
- 2019: Opal 1.0.0 was released with major runtime and compatibility changes.
- 2021: Opal 1.2 announced broad Ruby 3.0 feature support.
- 2022: Opal 1.6 and Opal-RSpec 1.0 improved MRI compatibility, testing, and compile performance.

### Related projects

- Opal's related ecosystem includes opal-browser, Opal-RSpec, Rack/Rails integration, and JavaScript library ports that let Ruby code interact with browser and Node APIs. The project also depends conceptually on MRI Ruby behavior and parser compatibility, because much of its value comes from matching Ruby semantics while producing JavaScript.

### 来源

- <https://github.com/opal/opal>
- <https://opalrb.com/>
- <https://opalrb.com/blog/2019/05/12/opal-1-0/>
- <https://opalrb.com/blog/2021/08/09/opal-1-2/>
- <https://opalrb.com/blog/2022/11/24/opal-1-6-opal-rspec-1-0/>
- <https://rubygems.org/gems/opal/versions>
- source_facts.executables
- source_facts.package-manager


## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation signal

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** opal
- **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


## 相关链接

- [Package publisher tools](https://pkg.so/zh-hans/package-publishers/) - Belongs to a package publishing or registry command family.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [ruby](https://pkg.so/zh-hans/brew/ruby/) - Runtime dependency declared by Homebrew.
- [ruby-build](https://pkg.so/zh-hans/brew/ruby-build/) - Shares pkgdb curated category or tags: cli, language-runtime, ruby.
- [ruby-install](https://pkg.so/zh-hans/brew/ruby-install/) - Shares pkgdb curated category or tags: cli, language-runtime, ruby.
- [mruby](https://pkg.so/zh-hans/brew/mruby/) - Shares pkgdb curated category or tags: cli, language-runtime, ruby.
- [jruby](https://pkg.so/zh-hans/brew/jruby/) - Shares pkgdb curated category or tags: cli, language-runtime, ruby.
- [picoruby](https://pkg.so/zh-hans/brew/picoruby/) - Shares pkgdb curated category or tags: cli, language-runtime, ruby.
- [rbenv-aliases](https://pkg.so/zh-hans/brew/rbenv-aliases/) - Shares pkgdb curated category or tags: cli, language-runtime, ruby.
- [typescript](https://pkg.so/zh-hans/brew/typescript/) - Shares pkgdb curated category or tags: cli, compiler, javascript, language-runtime.
- [cython](https://pkg.so/zh-hans/brew/cython/) - Shares pkgdb curated category or tags: cli, compiler, language-runtime, transpiler.
- [clojurescript](https://pkg.so/zh-hans/brew/clojurescript/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, compiler, javascript, language, language-runtime.
- [coffeescript](https://pkg.so/zh-hans/brew/coffeescript/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, compiler, javascript, language, language-runtime.

## Combined YAML source

View the package source record on GitHub. [combined/opal.yml](https://github.com/mxcl/pkgdb/blob/main/combined/opal.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- cross-ecosystem install command graph
