簡體   English   中英

Heroku推耙資產使用預編譯突然失敗

[英]Heroku push rake assets fail suddenly using precompile

我執行“ git push heroku master”時遇到錯誤。
我使用以下命令在本地編譯資產:

rake assets:precompile RAILS_ENV=production --trace

事實是,這在過去幾個月一直定期進行,直到昨天才決定失敗。

我還嘗試了以下內容從頭開始重新編譯,結果相同:

rake assets:clobber --trace
rake assets:precompile RAILS_ENV=production --trace

不知道如何調試它。 我最近的簽到看起來很合理(即我沒有編輯配置文件或rakefile等)。 我正在更改一些png圖像(新圖像,調整圖像大小),但是在本地進行預編譯似乎沒有顯示任何錯誤。

這是錯誤消息的開始。

remote: -----> Detecting rails configuration
remote: -----> Detecting rake tasks
remote:
remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     /tmp/build_a612be38eac01922e9ad7a0a8c37a351/vendor/bundle/ruby/2.2.0/gems/autoprefixer-rails-9.4.10/lib/autoprefixer-rails/processor.rb:83: warning: else without rescue is useless
remote:  !     rake aborted!
remote:  !     SyntaxError: /tmp/build_a612be38eac01922e9ad7a0a8c37a351/vendor/bundle/ruby/2.2.0/gems/autoprefixer-rails-9.4.10/lib/autoprefixer-rails/processor.rb:79: syntax error, unexpected '.'
remote:  !     from ||= if defined? Rails&.respond_to?(:root) && Rails&.root
remote:  !     ^
remote:  !     /tmp/build_a612be38eac01922e9ad7a0a8c37a351/vendor/bundle/ruby/2.2.0/gems/autoprefixer-rails-9.4.10/lib/autoprefixer-rails/processor.rb:79: syntax error, unexpected '.'
remote:  !     from ||= if defined? Rails&.respond_to?(:root) && Rails&.root
remote:  !     ^

煩人的是,這個問題花了整整一天時間試圖修復/研究后消失了。 第二天一切正常,我不知道為什么。 我做的最后一件事是在production.rb中注釋掉一行,構建所有內容,然后取消注釋。根本不確定是否相關。 僅供參考,線路是:

config.assets.precompile += ['landing.js', 'landing.css']

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM