ruby-on-rails - 如何解决 Sprockets::DoubleLinkError

标签 ruby-on-rails heroku sprockets

我在推送到 heroku repo 时遇到了这个错误

remote:        rake aborted!
remote:        Sprockets::DoubleLinkError: Multiple files with the same output path cannot be linked ("style.css")
remote:        In "/tmp/build_f430cee0cae4a9543fac20926137c7cc/app/assets/config/manifest.js" these files were linked:
remote:          - /tmp/build_f430cee0cae4a9543fac20926137c7cc/app/assets/stylesheets/style.css
remote:          - /tmp/build_f430cee0cae4a9543fac20926137c7cc/app/assets/stylesheets/style.scss
我已经尝试过这些建议:
  • 我删除了 .css 文件并保留了 .scss(AFAIK 没有重复)
  • 使用 heroku run rake tmp:clear
  • 清除临时目录
  • 使用 heroku repo:reset -a <app name>
  • 重置 repo
  • heroku repo:purge_cache -a <app name>

  • 但是当我推送到 Heroku Remote 时,我仍然不断收到错误消息

    最佳答案

    对我来说,这只是因为我有 两个样式表,而我应该只有一个 。就我而言,我有

    myapp/app/assets/stylesheets.application.css
    
    myapp/app/assets/stylesheets.application.css.scss
    
    我应该只有其中之一
    我删除了 application.css 问题就解决了

    关于ruby-on-rails - 如何解决 Sprockets::DoubleLinkError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62613142/

    相关文章:

    ruby-on-rails - number_to_currency 问题 100{ :separator= >",", :delimiter= >".", :raise=>true}000

    node.js - 由于缺少副本集参数,无法连接到heroku上的mongo

    Heroku + Sidekiq:ActiveRecord::StatementInvalid:PG::UnableToSend:SSL SYSCALL 错误:检测到 EOF

    javascript - rails 4 : How to add external javascript file from other site in a specific page

    ruby-on-rails - Rails/Assets 管道 : Dynamically list assets included in a manifest

    ruby-on-rails - 在scss中编译错误

    mysql - Ruby 和 Mysql2

    ruby-on-rails - 从 find 中返回唯一的年份

    ruby - 如何在 heroku 上使用事件机器监听器运行 ruby​​ 脚本?

    ruby-on-rails - 如何在 Rails 中停止样式表自动链接?