【发布时间】:2022-12-11 05:32:09
【问题描述】:
我最近升级到 Rails 7。一切都在本地工作(包括 bundle exec rails assets:precompile 但是,如果我在 Docker 中构建我的应用程序(部署到 Fly),我会看到这一行:RUN bundle exec rails assets:precompile 然后事情失败并显示此消息:
#23 16.19 Compiling...
#23 18.46 Compilation failed:
#23 18.46 Internal Error: project@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile
#23 18.46 at pQ.getCandidates (/root/.volta/tools/image/yarn/3.3.0/bin/yarn.js:435:5146)
#23 18.46 at Wf.getCandidates (/root/.volta/tools/image/yarn/3.3.0/bin/yarn.js:391:1264)
#23 18.46 at /root/.volta/tools/image/yarn/3.3.0/bin/yarn.js:439:7695
#23 18.46 at Rf (/root/.volta/tools/image/yarn/3.3.0/bin/yarn.js:390:8965)
#23 18.46 at ge (/root/.volta/tools/image/yarn/3.3.0/bin/yarn.js:439:7675)
#23 18.46
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -c bundle exec rails assets:precompile]: exit code: 1
据我所知,这个错误#23 18.46 Internal Error: project@workspace:.: This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile 是问题的关键(project@workspace 只是我项目的名称@workspace)。通常我希望这会列出一个包,但没有列出。我已经删除了锁定文件,yarn install 有效。 package.json 似乎没有什么不合适的。
关于可能破坏预编译的任何想法?
【问题讨论】:
标签: ruby-on-rails yarnpkg ruby-on-rails-7 fly