Rails Heroku deploy:预编译资产失败,SassC::SyntaxError

am46iovg  于 2023-11-19  发布在  其他
关注(0)|答案(1)|浏览(213)

在部署到heroku RoR项目期间,我收到一个错误“Precompiling assets failed”。
我试图找到css代码与“calc(100 vh-110 px)",但没有发现任何项目。
有什么问题吗?谢谢

remote: -----> Installing node-v20.9.0-linux-x64
remote: -----> Installing yarn-v1.22.19
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        yarn install v1.22.19
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
remote:        [3/4] Linking dependencies...
remote:        warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
remote:        warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
remote:        [4/4] Building fresh packages...
remote:        Done in 15.09s.
remote:        rake aborted!
remote:        SassC::SyntaxError: Error: "calc(100vh - 110px)" is not a number for `min'
remote:                on line 1:30534 of stdin, in function `min`
remote:                from line 1:30534 of stdin
remote:        >> x;flex:1;flex-direction:column;max-height:min(650px,calc(100vh - 110px));ove
remote:           ------------------------------------------^
remote:        stdin:1

字符串
我尝试运行rails assets:precompile:

Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
    /Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/set.rb:648: warning: already initialized constant Set::InspectKey
    /Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/set-1.0.3/lib/set.rb:815: warning: previous definition of InspectKey was here
    /Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:20: warning: already initialized constant Pathname::TO_PATH
    /Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:20: warning: previous definition of TO_PATH was here
    /Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:22: warning: already initialized constant Pathname::SAME_PATHS
    /Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:22: warning: previous definition of SAME_PATHS was here
    /Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:34: warning: already initialized constant Pathname::SEPARATOR_LIST
    /Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:34: warning: previous definition of SEPARATOR_LIST was here
    /Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:35: warning: already initialized constant Pathname::SEPARATOR_PAT
    /Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:35: warning: previous definition of SEPARATOR_PAT was here
    /Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:41: warning: already initialized constant Pathname::ABSOLUTE_PATH
    /Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:41: warning: previous definition of ABSOLUTE_PATH was here
    Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
    /Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/set.rb:648: warning: already initialized constant Set::InspectKey
    /Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/set-1.0.3/lib/set.rb:815: warning: previous definition of InspectKey was here
    Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
    /Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/set.rb:648: warning: already initialized constant Set::InspectKey
    /Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/set-1.0.3/lib/set.rb:815: warning: previous definition of InspectKey was here
    yarn install v1.22.15
    warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
    [1/4] 🔍  Resolving packages...
    success Already up-to-date.
    ✨  Done in 0.15s.
    Warning: you are using an unstable release of Node.js (v21.2.0). If you encounter issues with Node.js, consider switching to an Active LTS release. More info: https://docs.npmjs.com/try-the-latest-stable-version-of-node
    Everything's up-to-date. Nothing to do


我还尝试了:RAILS_ENV=production rails assets:precompile

olegmishyn@MacBook-Air-Oleg learnician % RAILS_ENV=production rails assets:precompile SECRET_KEY_BASE='07788fabf3594bf7c2d898acfd331bb39294bb613c2609e9d2966cd5593a3cb0131be5ce5165de67a10f24ade4bf45e5d74e80104beb79404f0f441b93e46eff'

Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
/Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/set.rb:648: warning: already initialized constant Set::InspectKey
/Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/set-1.0.3/lib/set.rb:815: warning: previous definition of InspectKey was here
/Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:20: warning: already initialized constant Pathname::TO_PATH
/Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:20: warning: previous definition of TO_PATH was here
/Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:22: warning: already initialized constant Pathname::SAME_PATHS
/Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:22: warning: previous definition of SAME_PATHS was here
/Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:34: warning: already initialized constant Pathname::SEPARATOR_LIST
/Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:34: warning: previous definition of SEPARATOR_LIST was here
/Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:35: warning: already initialized constant Pathname::SEPARATOR_PAT
/Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:35: warning: previous definition of SEPARATOR_PAT was here
/Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/pathname.rb:41: warning: already initialized constant Pathname::ABSOLUTE_PATH
/Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/pathname-0.2.1/lib/pathname.rb:41: warning: previous definition of ABSOLUTE_PATH was here
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
/Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/set.rb:648: warning: already initialized constant Set::InspectKey
/Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/set-1.0.3/lib/set.rb:815: warning: previous definition of InspectKey was here
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
/Users/olegmishyn/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/set.rb:648: warning: already initialized constant Set::InspectKey
/Users/olegmishyn/.rvm/gems/ruby-3.0.0/gems/set-1.0.3/lib/set.rb:815: warning: previous definition of InspectKey was here
yarn install v1.22.15
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.15s.
rails aborted!
SassC::SyntaxError: Error: "calc(100vh - 110px)" is not a number for `min'
        on line 1:30534 of stdin, in function `min`
        from line 1:30534 of stdin
>> x;flex:1;flex-direction:column;max-height:min(650px,calc(100vh - 110px));ove
   ------------------------------------------^

Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

y1aodyip

y1aodyip1#

通过将config.assets.css_compressor = nil添加到application.rb和production.rb +将node.js版本更改为“engines”来修复它:{“node”:“16.13.1”}在package.json中

相关问题