繁体   English   中英

Rails / Heroku问题

[英]Rails / Heroku Issues

我在Heroku上运行应用程序时遇到麻烦。 该应用程序在本地运行良好,并且在我推送时没有出现任何错误。

我有点菜鸟,但是这里有日志。...我到底在做什么错? 我确定有几件事;)

谢谢!

2014-08-02T02:56:42.476683+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler/webrick.rb:13:in `run'
2014-08-02T02:56:42.476676+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2014-08-02T02:56:42.476694+00:00 app[web.1]:    script/rails:6:in `require'
2014-08-02T02:56:42.476678+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
2014-08-02T02:56:42.476687+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2014-08-02T02:56:42.476686+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:268:in `start'
2014-08-02T02:56:42.476692+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2014-08-02T02:56:42.476724+00:00 app[web.1]: [2014-08-02 02:56:42] INFO  WEBrick::HTTPServer#start done.
2014-08-02T02:56:42.476702+00:00 app[web.1]: [2014-08-02 02:56:42] INFO  going to shutdown ...
2014-08-02T02:56:42.476691+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2014-08-02T02:56:45.569017+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)
 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)
2014-08-02T02:56:45.568550
+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)
/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2014-08-02T02:56:46.545364+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:33203
2014-08-02T02:56:46.545366+00:00 app[web.1]: => Call with -d to detach
2014-08-02T02:56:46.545359+00:00 app[web.1]: => Booting WEBrick
2014-08-02T02:56:46.545368+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-08-02T02:56:46.545369+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2014-08-02T02:56:46.732149+00:00 app[web.1]: [2014-08-02 02:56:46] INFO  WEBrick 1.3.1
2014-08-02T02:56:46.732161+00:00 app[web.1]: [2014-08-02 02:56:46] INFO  ruby 2.0.0 (2014-05-08) [x86_64-linux]
2014-08-02T02:56:46.732729+00:00 app[web.1]: [2014-08-02 02:56:46] INFO  WEBrick::HTTPServer#start: pid=2 port=33203
2014-08-02T02:56:43.886636+00:00 heroku[web.1]: Process exited with status 143
2014-08-02T02:56:42.010285+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-08-02T02:56:47.056544+00:00 heroku[web.1]: State changed from starting to up
2014-08-02T02:56:42.970420+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 33203`
2014-08-02T03:00:05.358113+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by barry.lachapelle@gmail.com
2014-08-02T03:00:09.590408+00:00 heroku[run.9409]: State changed from starting to up
2014-08-02T03:00:13.162415+00:00 heroku[run.9409]: State changed from up to complete
2014-08-02T03:00:09.290473+00:00 heroku[run.9409]: Awaiting client
2014-08-02T03:00:13.152932+00:00 heroku[run.9409]: Process exited with status 0
2014-08-02T03:00:09.342086+00:00 heroku[run.9409]: Starting process with command `bundle exec rake db:migrate`
2014-08-02T03:00:21.764691+00:00 app[web.1]: Started GET "/" for 106.147.253.226 at 2014-08-02 03:00:21 +0000
2014-08-02T03:00:22.034004+00:00 heroku[router]: at=info method=GET path="/" host=ruffbooks.herokuapp.com request_id=dc981a56-9021-454e-930f-e6a3f3715fbd fwd="106.147.253.226" dyno=web.1 connect=1ms service=279ms status=500 bytes=758
2014-08-02T03:00:22.016420+00:00 app[web.1]: Processing by StaticPagesController#index as HTML
2014-08-02T03:00:22.028108+00:00 app[web.1]:   Rendered static_pages/index.html.erb within layouts/application (1.7ms)
2014-08-02T03:00:22.029621+00:00 app[web.1]: 
2014-08-02T03:00:22.029623+00:00 app[web.1]: ActionView::Template::Error (defaults.js isn't precompiled):
2014-08-02T03:00:22.029625+00:00 app[web.1]:     3:   <head>
2014-08-02T03:00:22.029626+00:00 app[web.1]:     4:     <title><%= content_for?(:title) ? yield(:title) : "Untitled" %></title>
2014-08-02T03:00:22.029627+00:00 app[web.1]:     5:     <%= stylesheet_link_tag "application" %>
2014-08-02T03:00:22.029629+00:00 app[web.1]:     6:     <%= javascript_include_tag :defaults %>
2014-08-02T03:00:22.029630+00:00 app[web.1]:     7:     <%= csrf_meta_tag %>
2014-08-02T03:00:22.029634+00:00 app[web.1]:   app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__347943086722083126_69894744358040'
2014-08-02T03:00:22.028117+00:00 app[web.1]: Completed 500 Internal Server Error in 11ms
2014-08-02T03:00:22.029632+00:00 app[web.1]:     8:     <%= yield(:head) %>
2014-08-02T03:00:22.029635+00:00 app[web.1]: 
2014-08-02T03:00:22.029637+00:00 app[web.1]: 
2014-08-02T03:00:22.029633+00:00 app[web.1]:     9:   </head>
2014-08-02T03:00:22.872918+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=ruffbooks.herokuapp.com request_id=06611019-6bda-4c8c-b6a2-6cfc4ce1d2fa fwd="106.147.253.226" dyno=web.1 connect=1ms service=7ms status=200 bytes=748
2014-08-02T03:03:57+00:00 heroku[slug-compiler]: Slug compilation started
2014-08-02T03:04:09+00:00 heroku[slug-compiler]: Slug compilation finished
2014-08-02T03:04:09.949182+00:00 heroku[web.1]: State changed from up to starting
2014-08-02T03:04:09.852212+00:00 heroku[api]: Deploy 1d124f1 by barry.lachapelle@gmail.com
2014-08-02T03:04:09.852373+00:00 heroku[api]: Release v28 created by barry.lachapelle@gmail.com
2014-08-02T03:04:13.359256+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/handler/webrick.rb:13:in `run'
2014-08-02T03:04:13.359228+00:00 app[web.1]: [2014-08-02 03:04:13] FATAL SignalException: SIGTERM
2014-08-02T03:04:13.359238+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `select'
2014-08-02T03:04:13.359241+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `start'
2014
-08-02T03:04:13.359243+00:00 app[web.1]:        /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2014-08-02T03:04:13.359259+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2014-08-02T03:04:13.359261+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
2014-08-02T03:04:13.359240+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `block in start'
2014-08-02T03:04:13.359266+00:00 app[web.1]:    script/rails:6:in `require'
2014-08-02T03:04:13.359264+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2014-08-02T03:04:13.359258+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/server.rb:268:in `start'
2014-08-02T03:04:13.359268+00:00 app[web.1]:    script/rails:6:in `<main>'
2014-08-02T03:04:13.359263+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2014-08-02T03:04:13.359453+00:00 app[web.1]: [2014-08-02 03:04:13] INFO  going to shutdown ...
2014-08-02T03:04:13.359573+00:00 app[web.1]: [2014-08-02 03:04:13] INFO  WEBrick::HTTPServer#start done.
2014-08-02T03:04:13.359684+00:00 app[web.1]: Exiting
2014-08-02T03:04:14.853313+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)
log.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2014-08-02T03:04:14.852857+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)
 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)
2014-08-02T03:04:15.736918+00:00 app[web.1]: => Call with -d to detach
2014-08-02T03:04:15.736904+00:00 app[web.1]: => Booting WEBrick
2014-08-02T03:04:15.736921+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2014-08-02T03:04:15.812883+00:00 app[web.1]: [2014-08-02 03:04:15] INFO  ruby 2.0.0 (2014-05-08) [x86_64-linux]
2014-08-02T03:04:15.736909+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:29602
2014-08-02T03:04:15.812869+00:00 app[web.1]: [2014-08-02 03:04:15] INFO  WEBrick 1.3.1
2014-08-02T03:04:15.813293+00:00 app[web.1]: [2014-08-02 03:04:15] INFO  WEBrick::HTTPServer#start: pid=2 port=29602
2014-08-02T03:04:15.736920+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-08-02T03:04:16.188320+00:00 heroku[web.1]: State changed from starting to up
2014-08-02T03:04:12.761970+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2014-08-02T03:04:14.640636+00:00 heroku[web.1]: Process exited with status 143
2014-08-02T03:04:12.705585+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 29602`
2014-08-02T03:04:22.615561+00:00 heroku[router]: at=info method=GET path="/" host=ruffbooks.herokuapp.com request_id=81868db3-a7e9-4d85-ac67-6ba8f1424167 fwd="106.147.253.226" dyno=web.1 connect=0ms service=104ms status=500 bytes=758
2014-08-02T03:04:22.611352+00:00 app[web.1]:     4:     <title><%= content_for?(:title) ? yield(:title) : "Untitled" %></title>
2014-08-02T03:04:22.517499+00:00 app[web.1]: Started GET "/" for 106.147.253.226 at 2014-08-02 03:04:22 +0000
2014-08-02T03:04:22.611354+00:00 app[web.1]:     5:     <%= stylesheet_link_tag "application" %>
2014-08-02T03:04:22.611357+00:00 app[web.1]:     7:     <%= csrf_meta_tag %>
2014-08-02T03:04:22.611355+00:00 app[web.1]:     6:     <%= javascript_include_tag :defaults %>
2014-08-02T03:04:22.611346+00:00 app[web.1]: 
2014-08-02T03:04:22.611359+00:00 app[web.1]:     8:     <%= yield(:head) %>
2014-08-02T03:04:22.605983+00:00 app[web.1]:   Rendered static_pages/index.html.erb within layouts/application (1.7ms)
2014-08-02T03:04:22.611363+00:00 app[web.1]: 
2014-08-02T03:04:22.611360+00:00 app[web.1]:     9:   </head>
2014-08-02T03:04:22.611349+00:00 app[web.1]: ActionView::Template::Error (defaults.js isn't precompiled):
2014-08-02T03:04:22.611362+00:00 app[web.1]:   app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___3942217403030960468_70065509394080'
2014-08-02T03:04:22.611351+00:00 app[web.1]:     3:   <head>
2014-08-02T03:04:22.611365+00:00 app[web.1]: 
2014-08-02T03:04:22.598270+00:00 app[web.1]: Processing by StaticPagesController#index as HTML
2014-08-02T03:04:22.609526+00:00 app[web.1]: Completed 500 Internal Server Error in 11ms
2014-08-02T03:04:23.455514+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=ruffbooks.herokuapp.com request_id=f5d35eda-4dbd-4b4b-9954-27daea69e02c fwd="106.147.253.226" dyno=web.1 connect=1ms service=6ms status=200 bytes=748

在索引的第5行上使用<%= javascript_include_tag "application" %>

失误

为了给您更多有关在Heroku上运行应用程序的信息,您将遇到两种错误:

Heroku

在此处输入图片说明

滑轨

在此处输入图片说明

这些错误将在您尝试加载Heroku应用程序( http://***.herokuapp.com )时显示,并且相对容易解码。

  • Rails错误是由于您自己的代码而发生的(通常是语法错误)。
  • 由于您如何设置Heroku环境而发生Heroku错误(IE平台错误)

区别在于,如果您遇到Rails错误,则您的应用程序可以在Heroku上正确运行-只是存在很多内部问题,可能与语法有关。 如果看到Heroku错误,则从本质上讲这意味着您没有正确设置Heroku的平台(通常没有db ),这意味着您必须在Heroku上进行工作才能对其进行整理。


日志

您暗示的问题是Rails问题,因为您可以在日志中查看有关错误可能的详细信息。 重要说明是Heroku错误通常不会在您的日志中报告任何内容(但这是另一回事)

我强烈建议您使用LogEntries附加组件

在此处输入图片说明

安装此程序,然后在后端使用“实时”功能,可以使您更好地消化收到的错误。 至少它对我们有帮助

-

阅读日志本身就是一门艺术。 通常,您会寻找特定的“错误”消息-但是这样做可能非常困难。 我阅读日志的方式如下:

浏览您的附件后,我发现以下行:

ActionView::Template::Error (defaults.js isn't precompiled):

应该是错误(尽管它可能是另一个错误的一部分)。 它说明您的app/assets/javascripts/文件夹中没有defaults.js Jade McGough正确指出的含义,这意味着您需要引用“应用程序” JS文件

请用第5行替换以下代码:

并在项目路径上运行“ heroku run rake asset:precompile”此命令

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM