Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 无法推送到Heroku:Sprockets::FileNotFound:找不到application.css_Ruby On Rails_Ruby On Rails 4_Heroku_Sprockets - Fatal编程技术网

Ruby on rails 无法推送到Heroku:Sprockets::FileNotFound:找不到application.css

Ruby on rails 无法推送到Heroku:Sprockets::FileNotFound:找不到application.css,ruby-on-rails,ruby-on-rails-4,heroku,sprockets,Ruby On Rails,Ruby On Rails 4,Heroku,Sprockets,我过去可以毫无问题地推到Heroku。在做了一些似乎与我的问题无关的改变之后,它没有推进到Heroku。在git push heroku上,我得到了错误: ... remote: -----> Preparing app for Rails asset pipeline remote: Running: rake assets:precompile remote: rake aborted! remote: Sprockets::FileNotFo

我过去可以毫无问题地推到Heroku。在做了一些似乎与我的问题无关的改变之后,它没有推进到Heroku。在git push heroku上,我得到了错误:

...
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 .

有没有人知道是什么导致了这些问题,以及该怎么办?如果我可以通过重置某些内容来解决问题,那么这是一个选项,因为应用程序尚未启动,因此没有丢失数据的风险。

根据研究,可能有一些选项: 1) 只需将config.service\u static\u assets设置为true 2) 制作一个rake资源:在推之前进行预编译,同时查看是否有任何错误
3) .git文件在git目录中损坏

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

我知道有人问了关于Heroku的问题,但我在EngineYard上偶然发现了同样的问题,并找到了解决方案。由于我仍然有一个低代表性,我无法添加这作为一个评论,我张贴这作为一个答案,虽然有一个稍微不同的问题

首先,确保您的资产根本没有被编译(因为这是发生错误的地方)。 只需将这两行添加到/config/ey.yml即可

precompile_assets: false
precompile_unchanged_assets: false

然后使用rake任务部署代码:
rake tmp:cache:clear
(清除tmp/cache)或
rake tmp:clear
(清除所有缓存和套接字文件)

谢谢Joao。1) 我不想放弃整个资产管道;2) 因为我从来都不需要预编译,所以我不这么认为;3) 你有这方面的参考资料吗?然后我也许可以找到如何找出这是否真的是原因,以及如何解决它。就是这样!谢谢你,我也把这看作是春季杂志。您可以设置heroku config:set DISABLE_SPRING=1来禁用heroku上的SPRING。