Heroku上Ruby on Rails应用推送时,为何找不到application.css文件?

2026-04-11 15:022阅读0评论SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计316个文字,预计阅读时间需要2分钟。

Heroku上Ruby on Rails应用推送时,为何找不到application.css文件?

我尝试简化了您提供的开头内容,并确保字数不超过100字:

我曾成功部署应用至Heroku。调整后却无法推送。git push heroku时报错:'Preparing app for Rails asset pipelineremote: Running: rake'

我曾经能够毫无问题地推向Heroku.在做了一些似乎与我的问题无关的更改后,它无法推送到Heroku.在git push heroku上我收到错误:

Heroku上Ruby on Rails应用推送时,为何找不到application.css文件?

... remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: rake aborted! remote: Sprockets::FileNotFound: could not find file: /tmp/build_c657fd7***e8c75a3/app/assets/stylesheets/application.css remote: /tmp/build_790d1e***cab4395/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.3/lib/sprockets/loader.rb:103:in `load_from_unloaded' remote: /tmp/build_790d1***ab4395/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.3/lib/sprockets/loader.rb:60:in `block in load' ... remote: ! Precompiling assets failed. remote: ! Push rejected, failed to compile Ruby app remote: ! Push rejected to ***.

application.css确实存在于我的开发环境中,包括:

*= require_self *= require universal *= require bootstrap-datepicker3 *= require menu_header *= require table *= require wice_grid *= require_tree .

有没有人知道可能导致问题的原因以及该怎么办?如果我可以通过重置某些东西来解决它,那么这是一个选项,因为应用程序尚未生效,因此不存在丢失数据的风险.

我联系了Heroku,他们将其描述为一个slug缓存问题.使用 purge_cache清除缓存解决了它.

本文共计316个文字,预计阅读时间需要2分钟。

Heroku上Ruby on Rails应用推送时,为何找不到application.css文件?

我尝试简化了您提供的开头内容,并确保字数不超过100字:

我曾成功部署应用至Heroku。调整后却无法推送。git push heroku时报错:'Preparing app for Rails asset pipelineremote: Running: rake'

我曾经能够毫无问题地推向Heroku.在做了一些似乎与我的问题无关的更改后,它无法推送到Heroku.在git push heroku上我收到错误:

Heroku上Ruby on Rails应用推送时,为何找不到application.css文件?

... remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: rake aborted! remote: Sprockets::FileNotFound: could not find file: /tmp/build_c657fd7***e8c75a3/app/assets/stylesheets/application.css remote: /tmp/build_790d1e***cab4395/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.3/lib/sprockets/loader.rb:103:in `load_from_unloaded' remote: /tmp/build_790d1***ab4395/vendor/bundle/ruby/2.2.0/gems/sprockets-3.3.3/lib/sprockets/loader.rb:60:in `block in load' ... remote: ! Precompiling assets failed. remote: ! Push rejected, failed to compile Ruby app remote: ! Push rejected to ***.

application.css确实存在于我的开发环境中,包括:

*= require_self *= require universal *= require bootstrap-datepicker3 *= require menu_header *= require table *= require wice_grid *= require_tree .

有没有人知道可能导致问题的原因以及该怎么办?如果我可以通过重置某些东西来解决它,那么这是一个选项,因为应用程序尚未生效,因此不存在丢失数据的风险.

我联系了Heroku,他们将其描述为一个slug缓存问题.使用 purge_cache清除缓存解决了它.