Heroku 显示空白页面,在本地版本中有效

发布于 2024-10-14 06:30:49 字数 2004 浏览 1 评论 0原文

在线 Heroku 日志:

Started GET "/" for 180.246.231.210 at Tue Jan 25 08:25:43 -0800 2011
  Processing by Store::HomeController#index as HTML
  Country Load (7.6ms)  SELECT "countries".* FROM "countries" WHERE ("countries"."id" IS NULL) LIMIT 1
  Country Load (1.9ms)  SELECT "countries".* FROM "countries" LIMIT 1
  SQL (2.5ms)   SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
 FROM pg_attribute a LEFT JOIN pg_attrdef d
 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
 WHERE a.attrelid = '"zones"'::regclass
 AND a.attnum > 0 AND NOT a.attisdropped
 ORDER BY a.attnum
Completed   in 15ms

本地生产日志:

Started GET "/" for 127.0.0.1 at 2011-01-26 08:10:21 +0700
  Processing by Store::HomeController#index as HTML
  LeftSidebarLink Load (0.4ms)  SELECT "links".* FROM "links" WHERE ("links"."type" = 'LeftSidebarLink') AND ("links"."target_url" = 'http://localhost:3000/') ORDER BY position LIMIT 1
  LeftSidebarLink Load (0.2ms)  SELECT "links".* FROM "links" WHERE ("links"."type" = 'LeftSidebarLink') AND ("links"."target_url" IN ('/')) ORDER BY position LIMIT 1
  LeftSidebarLink Load (0.1ms)  SELECT "links".* FROM "links" WHERE ("links"."type" = 'LeftSidebarLink') AND ("links"."target_url" IN ('')) ORDER BY position LIMIT 1
1
2
3
  FeaturedBanner Load (0.3ms)  SELECT "featured_banners".* FROM "featured_banners" WHERE (active = '1' OR (date_start >= DATE('2011-01-26') AND DATE('2011-01-26') <= date_end))
  Image Load (0.2ms)  SELECT "images".* FROM "images" WHERE ("images"."id" = 4) LIMIT 1
  FooterLink Load (0.2ms)  SELECT "links".* FROM "links" WHERE ("links"."type" = 'FooterLink') AND ("links"."parent_id" IS NULL) ORDER BY position
Rendered store/home/index.html.erb within layouts/store_default (13.0ms)
Completed 200 OK in 175ms (Views: 63.2ms | ActiveRecord: 1.4ms)

注意:1、2、3 行是 logger.debug 的输出。

为什么两个完全相同的设置和文件集和数据库显示不同的输出?为什么 store/home/index.html.erb 没有加载到我的在线应用程序中?

ONLINE Heroku logs:

Started GET "/" for 180.246.231.210 at Tue Jan 25 08:25:43 -0800 2011
  Processing by Store::HomeController#index as HTML
  Country Load (7.6ms)  SELECT "countries".* FROM "countries" WHERE ("countries"."id" IS NULL) LIMIT 1
  Country Load (1.9ms)  SELECT "countries".* FROM "countries" LIMIT 1
  SQL (2.5ms)   SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
 FROM pg_attribute a LEFT JOIN pg_attrdef d
 ON a.attrelid = d.adrelid AND a.attnum = d.adnum
 WHERE a.attrelid = '"zones"'::regclass
 AND a.attnum > 0 AND NOT a.attisdropped
 ORDER BY a.attnum
Completed   in 15ms

LOCAL production logs:

Started GET "/" for 127.0.0.1 at 2011-01-26 08:10:21 +0700
  Processing by Store::HomeController#index as HTML
  LeftSidebarLink Load (0.4ms)  SELECT "links".* FROM "links" WHERE ("links"."type" = 'LeftSidebarLink') AND ("links"."target_url" = 'http://localhost:3000/') ORDER BY position LIMIT 1
  LeftSidebarLink Load (0.2ms)  SELECT "links".* FROM "links" WHERE ("links"."type" = 'LeftSidebarLink') AND ("links"."target_url" IN ('/')) ORDER BY position LIMIT 1
  LeftSidebarLink Load (0.1ms)  SELECT "links".* FROM "links" WHERE ("links"."type" = 'LeftSidebarLink') AND ("links"."target_url" IN ('')) ORDER BY position LIMIT 1
1
2
3
  FeaturedBanner Load (0.3ms)  SELECT "featured_banners".* FROM "featured_banners" WHERE (active = '1' OR (date_start >= DATE('2011-01-26') AND DATE('2011-01-26') <= date_end))
  Image Load (0.2ms)  SELECT "images".* FROM "images" WHERE ("images"."id" = 4) LIMIT 1
  FooterLink Load (0.2ms)  SELECT "links".* FROM "links" WHERE ("links"."type" = 'FooterLink') AND ("links"."parent_id" IS NULL) ORDER BY position
Rendered store/home/index.html.erb within layouts/store_default (13.0ms)
Completed 200 OK in 175ms (Views: 63.2ms | ActiveRecord: 1.4ms)

Note: That 1, 2, 3 lines were output of logger.debug.

How come two EXACTLY same setup and set of files and database shows different output?? Why is it somehow store/home/index.html.erb not getting loaded in my online application?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清君侧 2024-10-21 06:30:49

想一想:您是否真的将数据纳入 Heroku 的数据库中? (即为数据库播种)

Just a thought: Have you actually included the data into the database on Heroku? (i.e. Seed the database)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文