代码之家  ›  专栏  ›  技术社区  ›  txizzle

错误:Sprockets::FileNotFound:找不到文件“”应用程序。用于Heroku的scs

  •  3
  • txizzle  · 技术社区  · 11 年前

    我遇到了一些问题,Sprockets在rake assets:precompile期间找不到文件。我以前没有遇到过这个问题,但当我添加了一个生成的迁移(在本地构建)时,Heroku未能构建我的应用程序,我不知道为什么,因为它是在本地构建的(没有我运行额外的rake资产:预编译)。

    错误消息如下:

    -----> Preparing app for Rails asset pipeline
           Running: rake assets:precompile
           rake aborted!
           Sprockets::FileNotFound: could not find file: /tmp/build_dd4a799769e6963b7b292df72db58fd8/username-appname-uniqueid/app/assets/stylesheets/application.scss
    

    有什么帮助吗?感谢您抽出时间!

    顺便说一句,当我运行“rake assets:precompile”,然后推送到Heroku时,应用程序就会构建。然而,一个带有css类“fa bars”的项目会被搞砸……这是为什么?

    谢谢

    2 回复  |  直到 11 年前
        1
  •  8
  •   thibaudgg    11 年前

    我在Sprockets 3.3.3和Rails 4.2.3应用程序中添加了相同的问题。

    我通过清理我们的dyno构建缓存修复了它:

    heroku repo:purge_cache
    

    请注意,您的下一次部署将需要更长的时间,因为bundler缓存也将被清除。

        2
  •  0
  •   Igor Mironenko    8 年前

    在rails 5中,如果使用Bower,请取消对Bower_rails.rb的注释

      #bower_rails.install_before_precompile = true