Меня направили в Heroku для хостинга Ruby on Rails, и пока я думаю, что мне это действительно понравится. Просто интересно, может ли кто-нибудь там помочь мне понять, что не так.
Я следую инструкциям по созданию приложения на этом сайте, создаю и фиксирую git, отправляю код, и он появляется по адресу http://mylifebattlecry.heroku.com (хотя большая часть того, что я сделал, находится в пути /posts/). 500.html ошибка и по сути все выключается. Не могу даже вернуться на страницу, на которую вошел пост.
Мне кажется, что-то не так с настройкой базы данных. Я сделал, как они предложили, включая ...$ heroku rake db:migrate, и ничего.
Просто интересно, знает ли кто-нибудь, что я делаю неправильно. Вот инструкции, которые они дают для справки:
Установите гем Heroku: sudo gem install heroku Создайте новый репозиторий git для своего приложения (если вы еще этого не сделали):
cd myapp
git init && git add . && git commit -m "first commit"
Создайте новое приложение Heroku:
heroku create
Created http://sharp-autumn-42.com/ | [email protected]:sharp-autumn-42.git
Git remote heroku added
ПРИМЕЧАНИЕ. Имя приложения создается автоматически; не волнуйтесь, вы можете переименовать его в любое время.
Разверните свой код:
git push heroku master
Запустите миграции (или другие задачи начальной загрузки):
heroku rake db:migrate
Откройте развернутое приложение в браузере: heroku open
Вот журналы ..$ heroku, если это поможет:
brandon-gadocis-macbook-pro:mylifebattlecry bgadoci$ heroku logs -app mylifebattlecry
==> dyno-629271.log <==
==> production.log <==
# Logfile created on Sun Nov 22 18:26:06 -0800 2009
Processing PostsController#index (for 99.7.50.140 at 2009-11-22 18:26:07) [GET]
Rendering template within layouts/posts
Rendering posts/index
ActionView::TemplateError (PGError: ERROR: column votes.post_id does not exist
LINE 1: SELECT count(*) AS count_all FROM "votes" WHERE ("votes".pos...
^
: SELECT count(*) AS count_all FROM "votes" WHERE ("votes".post_id = 1) ) on line #58 of app/views/posts/index.html.erb:
55: </div>
56: <div id="vote"><br/>
57: <div id="votes">
58: <%= pluralize post.votes.count, 'Person' %> like the above BattleCry. <br/>
59: </div>
60: <%= link_to "Comments (#{post.comments.count})", post %>
61: </div>
app/views/posts/index.html.erb:58
app/views/posts/index.html.erb:51
app/views/posts/index.html.erb:45:in `each'
app/views/posts/index.html.erb:45
app/controllers/posts_controller.rb:11:in `index'
/home/heroku_rack/lib/static_assets.rb:9:in `call'
/home/heroku_rack/lib/last_access.rb:25:in `call'
/home/heroku_rack/lib/date_header.rb:14:in `call'
thin (1.0.1) lib/thin/connection.rb:80:in `pre_process'
thin (1.0.1) lib/thin/connection.rb:78:in `catch'
thin (1.0.1) lib/thin/connection.rb:78:in `pre_process'
thin (1.0.1) lib/thin/connection.rb:57:in `process'
thin (1.0.1) lib/thin/connection.rb:42:in `receive_data'
eventmachine (0.12.6) lib/eventmachine.rb:240:in `run_machine'
eventmachine (0.12.6) lib/eventmachine.rb:240:in `run'
thin (1.0.1) lib/thin/backends/base.rb:57:in `start'
thin (1.0.1) lib/thin/server.rb:150:in `start'
thin (1.0.1) lib/thin/controllers/controller.rb:80:in `start'
thin (1.0.1) lib/thin/runner.rb:173:in `send'
thin (1.0.1) lib/thin/runner.rb:173:in `run_command'
thin (1.0.1) lib/thin/runner.rb:139:in `run!'
thin (1.0.1) bin/thin:6
/usr/local/bin/thin:20:in `load'
/usr/local/bin/thin:20
Rendering /disk1/home/slugs/88382_601a216_9803/mnt/public/500.html (500 Internal Server Error)