3

刚开始使用 RefineryCMS,抱歉新手问题。它在本地运行良好,幸运地部署在 Heroku Cedar 堆栈上。创建了一个名为 Home 的页面。/pages/home 响应良好。

路线.rb

root :to => 'pages#home'

并在 localhost:3000 上工作,但在 Heroku 上会出错。

该应用程序在这里:

http://refkocedar.herokuapp.com/home有效 http://refkocedar.herokuapp.com/无效

如何在 Heroku 上将主页设置为 root?感谢帮助!

$ heroku 日志

2012-04-03T02:19:57+00:00 heroku[router]: GET refkocedar.herokuapp.com/assets/application-ddce3db0fc667014faf95d85d24c71d4.js dyno=web.1 queue=0 wait=0ms service=4ms status=304 bytes=0
2012-04-03T02:19:58+00:00 heroku[router]: GET refkocedar.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=4ms status=304 bytes=0
2012-04-03T02:19:58+00:00 app[web.1]: cache: [GET /favicon.ico] miss
2012-04-03T02:20:04+00:00 app[web.1]: 
2012-04-03T02:20:04+00:00 app[web.1]: 
2012-04-03T02:20:04+00:00 app[web.1]: Started GET "/" for 80.98.142.244 at 2012-04-03 02:20:04 +0000
2012-04-03T02:20:04+00:00 app[web.1]: cache: [GET /] miss
2012-04-03T02:20:04+00:00 app[web.1]: cache: [GET /] miss
2012-04-03T02:20:04+00:00 app[web.1]: cache: [GET /] miss
4

5 回答 5

8

我最近在 myocal 工作区上尝试了 Refinery 并且遇到了类似的问题。不确定heroku有什么不同,因为我没有尝试任何东西。这个解决方案对我有用。

http://groups.google.com/group/refinery-cms/browse_thread/thread/504b72ec2f1575d5

于 2012-04-03T02:49:48.283 回答
6

Refinery admin page you have a option as "forward this page" under advanced options. Set "/"

在这里,我将逐步解释如何将您的家设置为 root_path(localhost:3000)。

http://localhost:3000/refinery/login

username1.然后用你的和登录password

2.点击进入Pages

3.单击链接加载edit时要查看的页面。localhost:3000

4.点击Advanced Options

5./Forward this page to another website or page文本框中设置。然后点击Save

6.现在您的主页将显示在localhost:3000

于 2013-07-10T07:01:55.243 回答
3

Sonu 从谷歌群组链接到的内容是正确的。您需要在您的 routes.rb 中添加以下内容:

root :to => 'pages#home'

然后更改主页上的设置(在高级设置下),上面写着:

将此页面转发到另一个网站或页面

并将其转发到 /

这对我有用。

于 2012-04-17T19:04:31.427 回答
0

我会说这几乎可以肯定是您的 routes.rb 文件的错误。

我正在通过 Michael Hartl 的 Rails 教程来设置我的新应用程序,并一遍又一遍地遇到这个错误。

检查以确保 Heroku 知道正确的根路径,例如“root 'application#hello'”

于 2014-12-09T18:16:31.570 回答
0

非常简短的回答。在“高级选项”下,将“将此页面转发到另一个网站或页面”设置为/

听起来它不应该起作用,但它确实起作用。

于 2014-01-15T17:10:03.177 回答