我正在努力将一个新的 Rails 7 项目部署到生产中(在 Heroku 和 Render.com 上尝试),并且在构建过程中出现以下错误:
$ tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css
Done in 408ms.
Done in 0.90s.
rake aborted!
SassC::SyntaxError: Error: Function rgb is missing argument $green.
on line 428 of stdin
>> color: rgb(29 78 216 / var(--tw-text-opacity));
---------^
stdin:428
这就是我认为相关的部分,但如果有帮助,这里有更多的输出上下文。
Preparing app for Rails asset pipeline
Running: rake assets:precompile
yarn install v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 5.10s.
yarn run v1.22.17
$ esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds
app/assets/builds/application.js 185.5kb
app/assets/builds/application.js.map 301.0kb
Done in 0.10s.
yarn install v1.22.17
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.12s.
yarn run v1.22.17
$ tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css
Done in 408ms.
Done in 0.90s.
rake aborted!
SassC::SyntaxError: Error: Function rgb is missing argument $green.
on line 428 of stdin
>> color: rgb(29 78 216 / var(--tw-text-opacity));
---------^
stdin:428
/tmp/build_d9d0bde2/vendor/bundle/ruby/3.0.0/gems/sassc-2.4.0/lib/sassc/engine.rb:50:in `render'
/tmp/build_d9d0bde2/vendor/bundle/ruby/3.0.0/gems/sassc-rails-2.1.2/lib/sassc/rails/compressor.rb:29:in `call'
/tmp/build_d9d0bde2/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/sass_compressor.rb:30:in `call'
/tmp/build_d9d0bde2/vendor/bundle/ruby/3.0.0/gems/sprockets-4.0.2/lib/sprockets/processor_utils.rb:84:in `call_processor'
我使用rails new project_name -j esbuild --css tailwind
. 开发模式工作正常,只是生产部署。
我不确定从哪里开始调试它。