【问题标题】:Rails precompile assets on Heroku Sprockets::FileNotFoundRails 在 Heroku Sprockets::FileNotFound 上预编译资产
【发布时间】:2016-02-06 20:22:10
【问题描述】:

我尝试将我的简单 Rails 应用程序部署到 Heroku。这个应用程序只是尝试将 bower 与 Heroku 一起使用。

不幸的是,我在 Heroku 上的预编译资产有问题。 这给了我错误Sprockets::FileNotFound

remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        Sprockets::FileNotFound: couldn't find file './app/App'
remote:        (in /tmp/build_fe6dc0e2c0063705b279b26e4aa2432d/app/assets/javascripts/application.js:12)

我不知道可能是什么原因。 App.js 是我自己的文件,它肯定存在。

需要提到rake assets:precompile 在我的本地机器上正常工作。

这是我的applications.js,其中包括所有其他文件

//= require jquery
//= require jquery_ujs

//= require vendor/angular/angular
//= require vendor/angular-route/angular-route
//= require vendor/angular-resource/angular-resource
//= require vendor/angular-sanitize/angular-sanitize

//= require vendor/moment/moment
//= require vendor/angular-moment/angular-moment

//= require      ./app/App
//= require      ./app/router
//= require_tree ./app/controllers
//= require_tree ./app/directives
//= require_tree ./app/filters

在一些类似的问题中,我找到了运行heroku repo:purge_cache 的建议。 但这对我来说也失败了。

~/tmp/repo_tmp $ cd unpack
~/tmp/repo_tmp/unpack $ tar -zxf ../repo-cache.tgz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

所有源代码均在 GitHub 上发布 https://github.com/ivanovalexey/bowerrr

有人能帮我弄清楚吗? 谢谢。

【问题讨论】:

    标签: heroku ruby-on-rails-3.2 asset-pipeline


    【解决方案1】:

    解决了。问题在于文件名./app/App.js。我将其重命名为 ./app/main.js 并且有效。仍然想知道为什么它在本地无关紧要。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-26
      • 2021-05-15
      • 2013-03-26
      • 2021-11-12
      • 2014-06-27
      • 1970-01-01
      相关资源
      最近更新 更多