【发布时间】:2022-01-01 12:08:21
【问题描述】:
我正在尝试关注这个tutorial 来部署一个基本的“Hello, world!”使用 Rails 和 Heroku 的应用程序。
我到达git push heroku main 命令并在运行它时点击下面的错误消息。
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: yarn install v1.22.4
remote: [1/4] Resolving packages...
remote: error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.
remote: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
remote: I, [2021-11-22T22:40:17.749803 #1743] INFO -- : Writing /tmp/build_c74ce4bc/public/assets/manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js
remote: I, [2021-11-22T22:40:17.750027 #1743] INFO -- : Writing /tmp/build_c74ce4bc/public/assets/manifest-b4bf6e57a53c2bdb55b8998cc94cd00883793c1c37c5e5aea3ef6749b4f6d92b.js.gz
remote: I, [2021-11-22T22:40:17.750167 #1743] INFO -- : Writing /tmp/build_c74ce4bc/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css
remote: I, [2021-11-22T22:40:17.750260 #1743] INFO -- : Writing /tmp/build_c74ce4bc/public/assets/application-04024382391bb910584145d8113cf35ef376b55d125bb4516cebeb14ce788597.css.gz
remote: Compiling...
remote: Compilation failed:
remote: yarn run v1.22.4
remote: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
remote:
remote:
remote: error Command "webpack" not found.
remote:
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
我满足 Heroku 教程的所有先决条件,并且我正在使用特定版本的 ruby 和 Rails 来匹配 Learn enough rails tutorial
$ ruby -v
ruby 2.7.4p191
$ rails -v
Rails 6.1.4.1
$ gem -v
3.2.31
$ Bundler -v
Bundler version 2.2.31
我尝试使用 yarn 将 webpack 和 webpack-cli 包添加到 package.json 文件中的依赖项。但这并没有帮助。
我对编程很陌生,所以我可能会遗漏一些明显的东西。有没有人指点一下?
谢谢!
【问题讨论】:
标签: ruby-on-rails heroku webpack