gpt4 book ai didi

ruby-on-rails - Heroku:您要查找的页面不存在

转载 作者:行者123 更新时间:2023-12-03 22:39:48 26 4
gpt4 key购买 nike

当我尝试将我的应用部署到 Heroku 时出现此错误。在我执行 heroku run rake db:reset 之前,我的第一次部署运行良好。在此之后,我出现以下错误:“我们很抱歉,但出了点问题。”和“您要查找的页面不存在。您可能输入了错误的地址或页面可能已移动。”

我的 heroku 日志说:

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"%>

有人,你能帮帮我吗?

最佳答案

Heroku 似乎在提示您的 Assets 未预编译。我会通读 this tutorial关于 heroku 上的 rails,有一节专门介绍资源预编译。

您可以告诉您的应用程序在生产环境中预编译 Assets

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

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

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

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

关于ruby-on-rails - Heroku:您要查找的页面不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13777310/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com