Heroku:您正在寻找的页面不存在 [英] Heroku: The page you were looking for doesn't exist

查看:166
本文介绍了Heroku:您正在寻找的页面不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将我的应用程序部署到Heroku时,出现此错误。我的第一个部署工作正常之前,我正在做 heroku运行rake db:reset
在此之后,我有以下错误:我们很抱歉,但出错了。和您正在寻找的页面不存在,您可能错误输入了地址或页面可能已移动。



我的heroku日志说:

  2012-12-08T11:40:54 + 00:00 app [web.1]:ActionView :: Template :: Error(bootstrap .css未预编译):
2012-12-08T11:40:54 + 00:00 app [web.1]:9:<%= csrf_meta_tags%>
2012-12-08T11:40:54 + 00:00 app [web.1]:
2012-12-08T11:40:54 + 00:00 app [web.1]:8: <%= javascript_include_tagbootstrap,media:all%>

有人,你能帮我吗?

解决方案

看起来Heroku抱怨你的资产没有预编译。我通过本教程阅读了有关heroku的rails,到资源预编译。

您可以告诉您的应用程序预编译生产中的资产。

 #config / environments / production.rb 
config.assets.compile = true
#Heroku也要求这是false
config.assets.initialize_on_precompile = false

或者您可以使用rake任务预编译您的资产

 #在推向Heroku之前,然后您可以推送
rake资产:预编译

#或者推到heroku后b
heroku运行rake资源:预编译


I get this error when i try to deploy my app to Heroku. My first deployment works fine before I'm doing heroku run rake db:reset. After this, I have errors below: "We're sorry, but something went wrong." and "The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved."

My heroku logs says:

2012-12-08T11:40:54+00:00 app[web.1]: ActionView::Template::Error (bootstrap.css isn't precompiled):
2012-12-08T11:40:54+00:00 app[web.1]:     9:   <%= csrf_meta_tags %>
2012-12-08T11:40:54+00:00 app[web.1]: 
2012-12-08T11:40:54+00:00 app[web.1]:     8:   <%= javascript_include_tag "bootstrap", media: "all"%>

Some one, Can you help me ?

解决方案

Looks like Heroku is complaining that your assets are not precompiled. I'd read through this tutorial about rails on heroku, there is a section dedicated to resource pre-compilation.

You can tell your application to precompile assets in production

#config/environments/production.rb
config.assets.compile = true
# Heroku also requires this to be false
config.assets.initialize_on_precompile=false

Or you can precompile your assets using the rake task

#before pushing to Heroku and then you can push
rake assets:precompile

#or after you've pushed to heroku
heroku run rake assets:precompile

这篇关于Heroku:您正在寻找的页面不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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