1

我正在尝试将一个或多或少空白的 Rails 应用程序部署到 Heroku,但我不断收到“我们很抱歉,但出了点问题”的消息。

Heroku 日志中唯一的错误行是:

2013-01-11T19:30:59+00:00 heroku[router]: at=info method=GET path=/ host=murmuring-sierra-7952.herokuapp.com fwd=2.111.66.39 dyno=web.1 queue=0 wait=0ms connect=3ms service=718ms status=500 bytes=643

我将其理解为 heroku 无法获取根路径..

除了创建应用程序之外,我唯一做的就是生成一个控制器、博客、索引、显示、新等,并替换我的 routes.rb 中的根,如下所示:

resources :blogs
root :to => "blogs#index"

我什至添加了

match '/' => "blogs#index"

确保“/”实际上指向 blogs#index

在本地主机上一切正常,顺便说一句

谢谢, 维戈

4

1 回答 1

1

Heroku 不适用于 sqlite3,它适用于 postgresql。

您的 gemfile 中应该有以下内容:

group :development, :test do
  gem 'sqlite3'
end

group :production do
  gem 'pg'
end

然后运行

$ bundle install
$ git push heroku master

您将在 heroku 自己的部分中找到有关如何开始的更多信息。

于 2013-01-11T20:18:09.113 回答