Heroku 显示空白页面,在本地版本中有效
在线 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
想一想:您是否真的将数据纳入 Heroku 的数据库中? (即为数据库播种)
Just a thought: Have you actually included the data into the database on Heroku? (i.e. Seed the database)