首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >rails7 RAILS_ENV=production rails资产:未找到预编译错误命令“构建”

rails7 RAILS_ENV=production rails资产:未找到预编译错误命令“构建”
EN

Stack Overflow用户
提问于 2022-04-17 16:16:49
回答 1查看 599关注 0票数 -1

非常奇怪的错误,资产预编译在dev模式下工作得很好,但是一旦我做了生产模式,我就得到了错误:

代码语言:javascript
复制
root@53407ec15126:/app# RAILS_ENV=production rails assets:precompile
yarn install v1.22.18
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.04s.
yarn run v1.22.18
error Command "build" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
rails aborted!
jsbundling-rails: Command build failed, ensure yarn is installed and `yarn build` runs without errors

Tasks: TOP => assets:precompile => javascript:build
(See full trace by running task with --trace)
root@53407ec15126:/chinese-flashcards-app#

最奇怪的是,我甚至不使用纱线在我的项目(我使用重要地图)。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-04-17 16:27:00

好吧..。我想出了怎么做猴子补丁(叹气)。

将此添加到package.json

代码语言:javascript
复制
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "echo 1",
    "build:css": "echo 1"
  },

这并不能解决rails prod预处理器使用纱线/npm处理器的问题(我不需要它们)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71903502

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档