2013-05-25 4 views
0

У меня возникли проблемы с развертыванием в Heroku, я установил postgresql, но я не думаю, что я его правильно настроил. Это может быть или не быть проблемой, но у меня есть догадка, что это имеет какое-то отношение к ней. пожалуйста посоветуй.Невозможно развернуть в heroku [heroku log included]

мерзавец для блога: https://github.com/Apane/Blogit_blog

Обновлено Heroku Журналы

2013-05-25T02:32:07.946326+00:00 app[web.1]:  1: <div class="right1"> 
2013-05-25T02:32:07.946326+00:00 app[web.1]:  2: <%= login_required class: "actions", id: "new_blog_post_link" do %> 
2013-05-25T02:32:07.946326+00:00 app[web.1]:  3: <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %> 
2013-05-25T02:32:07.941979+00:00 app[web.1]: Rendered blogit/posts/index.html.erb within layouts/application (91.1ms) 
2013-05-25T02:32:07.946326+00:00 app[web.1]: 
2013-05-25T02:32:07.946326+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name): 
2013-05-25T02:32:07.946326+00:00 app[web.1]: app/controllers/application_controller.rb:5:in `current_user' 
2013-05-25T02:32:07.946326+00:00 app[web.1]: 
2013-05-25T02:32:07.946665+00:00 app[web.1]: 
2013-05-25T02:32:07.946326+00:00 app[web.1]: app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb__3752095678148312245_34603300' 
2013-05-25T02:32:07.946326+00:00 app[web.1]:  5: </div> 
2013-05-25T02:32:07.946326+00:00 app[web.1]:  4: <% end %> 
2013-05-25T02:32:07.997684+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2013-05-25T02:32:07.997684+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2013-05-25T02:32:10.467911+00:00 heroku[web.1]: Process exited with status 137 
2013-05-25T02:37:19.248690+00:00 heroku[slugc]: Slug compilation started 
2013-05-25T02:38:02.467323+00:00 heroku[api]: Deploy de08b17 by "email" 
2013-05-25T02:38:02.493201+00:00 heroku[api]: Release v9 created by "email" 
2013-05-25T02:38:02.544564+00:00 heroku[api]: Deploy de08b17 by "email" 
2013-05-25T02:38:03.445329+00:00 heroku[slugc]: Slug compilation finished 
2013-05-25T02:38:04.208989+00:00 heroku[web.1]: State changed from up to starting 
2013-05-25T02:38:06.350047+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 41915` 
2013-05-25T02:38:07.613671+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2013-05-25T02:38:08.321413+00:00 app[web.1]: [2013-05-25 02:38:08] ERROR SignalException: SIGTERM 
2013-05-25T02:38:08.321413+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select' 
2013-05-25T02:38:15.184606+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-05-25T02:38:15.184606+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-05-25T02:38:15.187273+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-05-25T02:38:16.758556+00:00 app[web.1]: [Blogit]: Blogit::Configuration#rss_feed_language has been deprecated. You can remove this from your blogit.rb configuration file 
2013-05-25T02:38:17.431528+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2013-05-25T02:38:17.431823+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2013-05-25T02:38:18.932239+00:00 app[web.1]: [2013-05-25 02:38:18] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] 
2013-05-25T02:38:18.932504+00:00 app[web.1]: [2013-05-25 02:38:18] INFO WEBrick::HTTPServer#start: pid=2 port=41915 
2013-05-25T02:38:18.932239+00:00 app[web.1]: [2013-05-25 02:38:18] INFO WEBrick 1.3.1 
2013-05-25T02:38:19.138465+00:00 heroku[web.1]: State changed from starting to up 
2013-05-25T02:38:19.286419+00:00 heroku[web.1]: Process exited with status 137 
2013-05-25T02:38:24.702435+00:00 app[web.1]: Started GET "/" for 99.233.170.104 at 2013-05-25 02:38:24 +0000 
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Call with -d to detach 
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Booting WEBrick 
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:41915 
2013-05-25T02:38:24.702435+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-05-25T02:38:24.865680+00:00 app[web.1]: Processing by Blogit::PostsController#index as HTML 
2013-05-25T02:38:25.061058+00:00 app[web.1]: Rendered blogit/posts/index.html.erb within layouts/application (130.6ms) 
2013-05-25T02:38:25.061376+00:00 app[web.1]: Completed 500 Internal Server Error in 196ms 
2013-05-25T02:38:25.063272+00:00 app[web.1]: 
2013-05-25T02:38:25.063272+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name): 
2013-05-25T02:38:25.063272+00:00 app[web.1]:  1: <div class="right1"> 
2013-05-25T02:38:25.063092+00:00 heroku[router]: at=info method=GET path=/ host=infinite-springs-1056.herokuapp.com fwd="99.233.170.104" dyno=web.1 connect=3ms service=407ms status=500 bytes=643 
2013-05-25T02:38:25.063272+00:00 app[web.1]:  2: <%= login_required class: "actions", id: "new_blog_post_link" do %> 
2013-05-25T02:38:25.063272+00:00 app[web.1]:  4: <% end %> 
2013-05-25T02:38:25.063585+00:00 app[web.1]: 
2013-05-25T02:38:25.063272+00:00 app[web.1]:  3: <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %> 
2013-05-25T02:38:25.063272+00:00 app[web.1]:  5: </div> 
2013-05-25T02:38:25.063272+00:00 app[web.1]: app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb___1859728747634219045_31435420' 
2013-05-25T02:38:25.063272+00:00 app[web.1]: 
2013-05-25T02:38:25.063272+00:00 app[web.1]: app/controllers/application_controller.rb:5:in `current_user' 
2013-05-25T02:39:31.009984+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by "email" 
2013-05-25T02:39:35.228241+00:00 heroku[run.1589]: Awaiting client 
2013-05-25T02:39:35.254224+00:00 heroku[run.1589]: Starting process with command `bundle exec rake db:migrate` 
2013-05-25T02:39:36.715005+00:00 heroku[run.1589]: State changed from starting to up 
2013-05-25T02:39:43.583619+00:00 heroku[run.1589]: Process exited with status 0 
2013-05-25T02:39:43.598693+00:00 heroku[run.1589]: State changed from up to complete 
2013-05-25T02:47:44.635791+00:00 heroku[api]: Deploy 3b2c0e0 by "email" 
2013-05-25T02:47:44.659753+00:00 heroku[api]: Release v10 created by "email" 
2013-05-25T02:47:44.704699+00:00 heroku[api]: Deploy 3b2c0e0 by "email" 
2013-05-25T02:47:45.205793+00:00 heroku[web.1]: State changed from up to starting 
2013-05-25T02:47:48.591029+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 27123` 
2013-05-25T02:47:49.862664+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2013-05-25T02:47:50.836497+00:00 app[web.1]: [2013-05-25 02:47:50] ERROR SignalException: SIGTERM 
2013-05-25T02:47:50.836497+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select' 
2013-05-25T02:47:54.610704+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them 
in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-05-25T02:47:54.611109+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-05-25T02:47:54.611344+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2013-05-25T02:47:56.472610+00:00 app[web.1]: [Blogit]: Blogit::Configuration#rss_feed_language has been deprecated. You can remove this from your blogit.rb configuration file 
2013-05-25T02:47:57.907795+00:00 app[web.1]: [2013-05-25 02:47:57] INFO WEBrick 1.3.1 
2013-05-25T02:47:57.907795+00:00 app[web.1]: [2013-05-25 02:47:57] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] 
2013-05-25T02:47:57.908723+00:00 app[web.1]: [2013-05-25 02:47:57] INFO WEBrick::HTTPServer#start: pid=2 port=27123 
2013-05-25T02:47:58.197066+00:00 heroku[web.1]: State changed from starting to up 
2013-05-25T02:47:58.851641+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2013-05-25T02:47:58.851887+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Booting WEBrick 
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:27123 
2013-05-25T02:48:00.088867+00:00 app[web.1]: Started GET "/" for 99.233.170.104 at 2013-05-25 02:48:00 +0000 
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-05-25T02:48:00.088867+00:00 app[web.1]: => Call with -d to detach 
2013-05-25T02:48:00.290164+00:00 app[web.1]: Processing by Blogit::PostsController#index as HTML 
2013-05-25T02:48:00.460839+00:00 app[web.1]: Rendered blogit/posts/index.html.erb within layouts/application (98.8ms) 
2013-05-25T02:48:00.462767+00:00 app[web.1]: 
2013-05-25T02:48:00.462767+00:00 app[web.1]:  1: <div class="right1"> 
2013-05-25T02:48:00.461055+00:00 app[web.1]: Completed 500 Internal Server Error in 171ms 
2013-05-25T02:48:00.462767+00:00 app[web.1]: ActionView::Template::Error (unknown attribute: name): 
2013-05-25T02:48:00.462767+00:00 app[web.1]:  4: <% end %> 
2013-05-25T02:48:00.462767+00:00 app[web.1]:  3: <%= link_to t(:new_blog_post, scope: 'blogit.posts'), new_post_path %> 
2013-05-25T02:48:00.462767+00:00 app[web.1]:  2: <%= login_required class: "actions", id: "new_blog_post_link" do %> 
2013-05-25T02:48:00.462767+00:00 app[web.1]:  5: </div> 
2013-05-25T02:48:00.462767+00:00 app[web.1]: app/controllers/application_controller.rb:5:in `current_user' 
2013-05-25T02:48:00.462767+00:00 app[web.1]: app/views/blogit/posts/index.html.erb:2:in `_app_views_blogit_posts_index_html_erb___1549385033592403810_36478100' 
2013-05-25T02:48:00.462767+00:00 app[web.1]: 
2013-05-25T02:48:00.463077+00:00 app[web.1]: 
2013-05-25T02:48:00.471980+00:00 heroku[router]: at=info method=GET path=/ host=infinite-springs-1056.herokuapp.com fwd="99.233.170.104" dyno=web.1 connect=3ms service=421ms status=500 bytes=643 
2013-05-25T02:48:01.026129+00:00 heroku[web.1]: Process exited with status 137 

ответ

1

Как указано в журналах ошибок, проблема исходит из

app/controllers/application_controller.rb:5:in `current_user' 

которая

@current_user ||= User.first || User.create!(name: "APane") 

Вы пытаетесь создать новую строку в таблице пользователя Попутно в атрибуте имени в таблице пользователя, но он не существует. В вашей схеме пользователь не имеет поля имени. Вам нужно будет создать миграцию, чтобы добавить ее.

Возможно, вам захочется осведомиться и о базовом понимании применений рельсов. guides очень полезны.

+0

Спасибо, что это делалось, хотя функциональность блога не отображается на старте Heroku. Нужно ли мне обновлять динамики, чтобы получить функциональность, работающую на Heroku? Я хотел бы услышать ваши мысли. – Apane101

+0

Я не уверен, что вы подразумеваете под «обновлением динозавров». Вы вообще тестируете свое приложение? – darethas

1

Столкнулись 'Heroku запустить грабли БД: мигрировать? Похоже, что Heroku не видит вашу модель User, а это значит, что она еще не может быть в базе данных.

Вот аналогичный вопрос: Heroku Postgres Error: PGError: ERROR: relation "organizations" does not exist (ActiveRecord::StatementInvalid)

+0

+1 yup, необходимо создать таблицу через миграцию. –

+0

Спасибо, ребята, я выполнил миграцию, но все равно получаю сообщение об ошибке - проверьте обновленные журналы. – Apane101

+0

в вашем user.rb, попробуйте изменить переменную экземпляра имени в self.name и посмотреть, что произойдет – darethas

0

Похоже, вы используете WEBrick, я уверен, что вы должны использовать Thin для Heroku. Не уверен, что это исправит вашу проблему.

+0

Хорошо, как мне переключиться на тонкий? – Apane101

+0

Добавьте свой gemfile. gem 'thin' –

+0

Коррекция Я предполагаю, что они хотят единорога сейчас: https://devcenter.heroku.com/articles/rails-unicorn –

0

Я заметил, что у вас Gemfile у вас есть ошибка с номером end в вашей группе :production.

Изменить этот

group :production do 
    gem 'pg' 
    end 

к этому

group :production do 
    gem 'pg' 
end 

Кроме того, если вы используете sqlite для развития и postgresql для производства, и вы не уверены в установке postgresql правильно. Сделайте это

bundle install --without production 

Это поможет вам начать работу на Heroku.

Однако Heroku не рекомендует запускать разные базы данных при разработке и производстве, поскольку это может привести к затруднению поиска ошибок и т. Д. Поэтому было бы разумно выяснить, как быстро запустить postgresql в обеих средах. Надеюсь, что это поможет вам начать работу

+0

Спасибо, обновил исходное сообщение .. Проблема сохраняется. Мне нравится слышать ваши мысли и предложения. – Apane101

+1

Фактически, это исправило ошибку, которую вы опубликовали, прежде чем обновлять журнал. Ошибка postgresql. Теперь у вас есть другая ошибка 'ActionView :: Template :: Error (неизвестный атрибут: name):' Попробуйте установить это в своей среде разработки на вашей локальной машине. Если вы не можете понять это, просто опубликуйте новый вопрос. Вы не должны морфировать вопросы после их публикации. Я рад помочь – fontno

+0

Отступы - это просто конвекция (строго соблюдаемая, хотя и неактивная), и она не будет вызывать ошибки в однозначных случаях. – darethas

Смежные вопросы