You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

关于jsbundling-rails中bun命令未被终端识别的技术问询

关于jsbundling-rails中Bun/Esbuild命令不被识别的问题

我遇到了jsbundling-rails gem的相关问题,已在GitHub上提问,同时在此发布以获得更多关注。

我为新Rails应用尝试安装了多款不同的bundler,但均遇到相同错误:“bun”或“esbuild”不被识别为有效命令。以bun为例(它的安装流程看似最简单),想请教在其安装脚本中,bun命令实际是如何添加的?它是尝试添加符号链接到系统路径,还是直接向Rails应用添加任务?我推测当前终端配置(Git Bash+Zsh+Windows)可能不支持符号链接。

执行./bin/rails javascript:install:bun安装过程无异常,但运行bin/dev时出现如下错误:

the_best git:(master) ✗ bin/dev
20:07:23 web.1  | started with pid 4824
20:07:23 js.1   | started with pid 13740
20:07:23 css.1  | started with pid 16112
20:07:23 js.1   | unknown command: bun run build --watch
20:07:23 js.1   | yarn run v1.22.22
20:07:23 css.1  | yarn run v1.22.22
20:07:23 js.1   | $ bun bun.config.js --watch
20:07:24 css.1  | error Command "build:css" not found.
20:07:24 css.1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
20:07:24 js.1   | 'bun' is not recognized as an internal or external command,
20:07:24 js.1   | operable program or batch file.
20:07:24 js.1   | error Command failed with exit code 1.
20:07:24 js.1   | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
20:07:24 js.1   | exited with code 1

内容的提问来源于stack exchange,提问作者bjorn

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.18 06:49:54