【问题标题】:How to get content to display on Heroku from a Ruby app built with Nesta CMS?如何从使用 Nesta CMS 构建的 Ruby 应用程序中获取要在 Heroku 上显示的内容?
【发布时间】:2013-08-12 17:44:15
【问题描述】:

我添加了演示文件并在本地运行了该应用程序

但是当我部署到heroku时遇到问题,内容没有显示



我阅读了nesta官方网站上的文档 http://nestacms.com/docs/deployment/heroku 但他们几乎只是发表评论而不是提供指导

确保正确填写 config/config.yml(最重要的是确保关闭缓存,因为我们无法写入 Heroku 的文件系统)。

好吧,我在其他地方关注了他们的文档 http://nestacms.com/docs/config

然后对我的config.yml 文件进行了更改。以下最相关的更改

title: "Practice Nesta Site"
subtitle: "Nesta is pretty cool"

author:
  name: Juan Gallardo
  uri: nestademo1.herokuapp.com
  email: jgallardo720@gmail.com

# cache
#     Set it to true if you'd like Nesta to cache your pages in ./public.
#     Useful if you're deploying Nesta with a proxy server such as Nginx,
#     but not in the least bit helpful if your pages are dynamic, or you're
#     deploying Nesta to Heroku.
#
cache: false

# content
#     The root directory where nesta will look for your article files.
#     Should contain "pages" and "attachments" subdirectories that contain
#     your actual content and the (optional) menu.txt file that links to your
#     main category pages.
#
content: content

# Overriding "cache" and "content" in production is recommended if you're
# deploying Nesta to your own server (but see the deployment documentation
# on the Nesta site). Setting google_analytics_code in production is
# recommended regardless of how you're deploying (if you have a GA account!).
#
# Don't forget to uncomment the "production:" line too...

production:
  cache: false    
  content: /var/apps/nesta/shared/content
#  google_analytics_code: "UA-???????-?"

read_more: See full page

此要点的完整文件
https://gist.github.com/JGallardo/6195651

我运行 heroku 日志

jgallardo:demo-site juan.gallardo$ heroku logs 2013-08-09T17:22:21+00:00 heroku[slug-compiler]: Slug compilation started 2013-08-09T17:23:35.001505+00:00 heroku[api]: Scale to web=1 by jgallardo720@gmail.com 2013-08-09T17:23:35.026933+00:00 heroku[api]: Deploy 953af2e by jgallardo720@gmail.com 2013-08-09T17:23:35.046866+00:00 heroku[api]: Release v3 created by jgallardo720@gmail.com 2013-08-09T17:23:35.085708+00:00 heroku[api]: Deploy 953af2e by jgallardo720@gmail.com 2013-08-09T17:23:35+00:00 heroku[slug-compiler]: Slug compilation finished 2013-08-09T17:23:39.139164+00:00 heroku[web.1]: Starting process with commandbundle exec rackup config.ru -p 4751 2013-08-09T17:23:42.686255+00:00 app[web.1]: [2013-08-09 17:23:42] INFO WEBrick 1.3.1 2013-08-09T17:23:42.686255+00:00 app[web.1]: [2013-08-09 17:23:42] INFO ruby 2.0.0 (2013-06-27) [x86_64-linux] 2013-08-09T17:23:42.686477+00:00 app[web.1]: [2013-08-09 17:23:42] INFO WEBrick::HTTPServer#start: pid=2 port=4751 2013-08-09T17:23:43.030091+00:00 heroku[web.1]: State changed from starting to up 2013-08-09T17:36:17.229501+00:00 heroku[router]: at=info method=GET path=/ host=nestademo1.herokuapp.com fwd="98.173.1.66" dyno=web.1 connect=4ms service=51ms status=404 bytes=1570 2013-08-09T17:36:17.658553+00:00 heroku[router]: at=info method=GET path=/css/master.css host=nestademo1.herokuapp.com fwd="98.173.1.66" dyno=web.1 connect=4ms service=129ms status=200 bytes=5548

【问题讨论】:

  • 不要链接到您的 config.yml,在您的问题中包含重要信息。如果链接断开,您的问题将没有必要的信息并且将毫无用处。

标签: ruby heroku sinatra nestacms


【解决方案1】:

这行是问题所在:

content: /var/apps/nesta/shared/content

改成这样:

content: content

并确保将您的内容签入代码仓库。你可能已经找到了这个页面,对吧? http://nestacms.com/docs/deployment/heroku

【讨论】:

  • 是的,我看到了该页面并在问题中引用了它。但是说明书上没有提到你上面说的。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-01-23
  • 2017-05-12
  • 2012-05-27
  • 1970-01-01
  • 2012-09-16
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多