【问题标题】:RefineryCMS routes for Home page doesn't work主页的 RefineryCMS 路由不起作用
【发布时间】:2012-04-03 02:21:24
【问题描述】:

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

routes.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

【问题讨论】:

  • 你能运行heroku logs看看错误是什么吗?
  • 好的,忘记了,谢谢,刚刚添加

标签: ruby-on-rails-3 heroku routes refinerycms cedar


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

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

    这里我一步一步解释如何将你的家设置为root_path(localhost:3000)。

    转到http://localhost:3000/refinery/login

    1.然后使用您的usernamepassword 登录。

    2.点击Pages

    3.点击edit链接你想在localhost:3000加载时看到的页面。

    4.点击Advanced Options

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

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

    【讨论】:

      【解决方案3】:

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

      root :to => 'pages#home'
      

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

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

      并将其转发到 /

      这对我有用。

      【讨论】:

        【解决方案4】:

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

        这听起来不应该有效,但确实有效。

        【讨论】:

          【解决方案5】:

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

          我正在阅读 Michael Hartl 的 Rails 教程来设置我的新应用程序,但一次又一次地遇到这个错误。

          检查以确保 Heroku 知道正确的根路径,例如“根‘应用程序#hello’”

          【讨论】:

            猜你喜欢
            • 2015-03-29
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2023-04-06
            • 2018-08-16
            • 2017-03-25
            • 1970-01-01
            相关资源
            最近更新 更多