我的大部分资产突然回到了404,推动了英雄 [英] Most of my assets suddenly return 404 after a push to heroku

查看:170
本文介绍了我的大部分资产突然回到了404,推动了英雄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经部署了这个应用程序(rails 3.2.11)一百万次,我没有搞砸任何设置,但现在我接到了这个:





为什么会发生这种情况出蓝色?我的应用程序包括 config.assets.enabled = true - 从来没有任何问题。



事实上在端口3000上运行它似乎没有任何问题。



今天早上部署到heroku之后,似乎没有加载任何东西有趣的是,在将文件复制后,只需制作一个新的应用程序, git commit 导致您所期望的所有内容以及我认为可能相关的一些长列表:





编辑:有趣的是,有些资产已经加载,像徽标和背景,但其余的,你可以看到返回404。

解决方案

今天有这个问题,rails4在heroku上。 @Jeff提供的文章有点旧,但宝库存储库具有良好的自述。
总结一下,您需要在Gemfile中添加两个宝石:


  1. gem'rails_serve_static_assets' / code>(它将解决静态资产问题)和

  2. gem'rails_stdout_logging'(前一个取决于on)。


I have deployed this app (rails 3.2.11) a million times, I haven't messed with any settings, but now I'm greeted with this:

Why did this happen out of the blue? My conents of application.rb include config.assets.enabled = true - never had any issues.

In fact running it locally on port 3000 seems to not have any issues whatsoever.

After deploying to heroku this morning, it seems that it loads nothing that's inside /assets/

Interestingly, after copying the files over to try and just make a new app, git commit results in all the stuff you'd expect as well as a LONG list of these which I think might be related:

Edit: Interestingly enough SOME of the assets have loaded, like the logo and the background, but the rest as you can see return 404.

解决方案

I had this problem today with rails 4 on heroku. The article provided by @Jeff is a little bit old but, the gem repository has a good readme. Summarizing, you will need to add two gems to your Gemfile:

  1. gem 'rails_serve_static_assets' (it will solve the static assets problem) and
  2. gem 'rails_stdout_logging' (which the previous one depends on).

这篇关于我的大部分资产突然回到了404,推动了英雄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆