2012-06-30 56 views
2

因此Heroku整天都在關閉,當然我直到我對應用做了大量改動才意識到這一點。現在,Heroku已經備份,我的應用程序已損壞。出錯了。 Heroku應用問題

這是一個隨機文本塊使stackoverflow認爲我已經更好地解釋了我的代碼塊,因爲他們不會讓我發佈,否則。

這是我的Heroku的日誌:

2012-06-30T22:58:31+00:00 app[web.1]: app/helpers/application_helper.rb:23:in `landing_photo' 
2012-06-30T22:58:31+00:00 app[web.1]: app/views/pages/home.html.erb:3:in `_app_views_pages_home_html_erb__3529485503375966156_14193960' 
2012-06-30T22:58:31+00:00 app[web.1]: 
2012-06-30T22:58:31+00:00 app[web.1]: 
2012-06-30T22:58:31+00:00 heroku[router]: GET jasonmccarthy.ie/ dyno=web.1 queue=0 wait=0ms service=195ms status=500 bytes=643 
2012-06-30T22:58:31+00:00 heroku[nginx]: 194.46.182.60 - - [30/Jun/2012:22:58:31 +0000] "GET/HTTP/1.1" 500 643 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11" jasonmccarthy.ie 
2012-06-30T22:58:48+00:00 heroku[run.1]: Awaiting client 
2012-06-30T22:58:48+00:00 heroku[run.1]: Starting process with command `bundle exec rake db:migrate` 
2012-06-30T22:58:48+00:00 heroku[run.1]: State changed from starting to up 
2012-06-30T22:58:54+00:00 heroku[run.1]: Process exited with status 0 
2012-06-30T22:58:54+00:00 heroku[run.1]: State changed from up to complete 
2012-06-30T22:58:57+00:00 app[web.1]: 
2012-06-30T22:58:57+00:00 app[web.1]: 
2012-06-30T22:58:57+00:00 app[web.1]: Started GET "/" for 194.46.182.60 at 2012-06-30 22:58:57 +0000 
2012-06-30T22:58:57+00:00 app[web.1]: Processing by PagesController#home as HTML 
2012-06-30T22:58:57+00:00 app[web.1]: Rendered pages/home.html.erb within layouts/application (0.7ms) 
2012-06-30T22:58:57+00:00 app[web.1]: Completed 500 Internal Server Error in 1ms 
2012-06-30T22:58:57+00:00 heroku[router]: GET jasonmccarthy.ie/ dyno=web.1 queue=0 wait=0ms service=15ms status=500 bytes=643 
2012-06-30T22:58:57+00:00 app[web.1]: 
2012-06-30T22:58:57+00:00 app[web.1]: ActionView::Template::Error (can't convert Range into Integer): 
2012-06-30T22:58:57+00:00 app[web.1]:  1: <% provide(:title, 'Jason Mc Carthy | Fashion Photography Wedding Photography') %> 
2012-06-30T22:58:57+00:00 app[web.1]:  2: 
2012-06-30T22:58:57+00:00 app[web.1]:  3: <%= landing_photo %> 
2012-06-30T22:58:57+00:00 app[web.1]: app/helpers/application_helper.rb:23:in `landing_photo' 
2012-06-30T22:58:57+00:00 app[web.1]:  4: 
2012-06-30T22:58:57+00:00 app[web.1]: app/helpers/application_helper.rb:23:in `rand' 
2012-06-30T22:58:57+00:00 app[web.1]:  5: <span id="tagline">Endeavouring to build a creative &amp; inspiring 2D world</span> 
2012-06-30T22:58:57+00:00 app[web.1]: app/views/pages/home.html.erb:3:in `_app_views_pages_home_html_erb__3529485503375966156_14193960' 
2012-06-30T22:58:57+00:00 app[web.1]: 
2012-06-30T22:58:57+00:00 app[web.1]: 
2012-06-30T22:58:57+00:00 heroku[nginx]: 194.46.182.60 - - [30/Jun/2012:22:58:57 +0000] "GET/HTTP/1.1" 500 643 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11" jasonmccarthy.ie 
2012-06-30T23:04:47+00:00 heroku[slugc]: Slug compilation started 
2012-06-30T23:05:24+00:00 heroku[api]: Release v30 created by [email protected] 
2012-06-30T23:05:24+00:00 heroku[api]: Deploy b7f77bc by [email protected] 
2012-06-30T23:05:24+00:00 heroku[web.1]: State changed from up to starting 
2012-06-30T23:05:25+00:00 heroku[slugc]: Slug compilation finished 
2012-06-30T23:05:26+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 18620` 
2012-06-30T23:05:27+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2012-06-30T23:05:28+00:00 app[web.1]: [2012-06-30 23:05:28] ERROR SignalException: SIGTERM 
2012-06-30T23:05:28+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select' 
2012-06-30T23:05:29+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) 
2012-06-30T23:05:29+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) 
2012-06-30T23:05:34+00:00 app[web.1]: [2012-06-30 23:05:34] INFO WEBrick 1.3.1 
2012-06-30T23:05:34+00:00 app[web.1]: [2012-06-30 23:05:34] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] 
2012-06-30T23:05:34+00:00 app[web.1]: [2012-06-30 23:05:34] INFO WEBrick::HTTPServer#start: pid=1 port=18620 
2012-06-30T23:05:35+00:00 heroku[web.1]: State changed from starting to up 
2012-06-30T23:05:36+00:00 app[web.1]: => Booting WEBrick 
2012-06-30T23:05:36+00:00 app[web.1]: => Rails 3.2.3 application starting in production on http://0.0.0.0:18620 
2012-06-30T23:05:36+00:00 app[web.1]: => Call with -d to detach 
2012-06-30T23:05:36+00:00 app[web.1]: => Ctrl-C to shutdown server 
2012-06-30T23:05:36+00:00 app[web.1]: 
2012-06-30T23:05:36+00:00 app[web.1]: 
2012-06-30T23:05:36+00:00 app[web.1]: Started GET "/" for 194.46.182.60 at 2012-06-30 23:05:36 +0000 
2012-06-30T23:05:36+00:00 app[web.1]: Processing by PagesController#home as HTML 
2012-06-30T23:05:36+00:00 app[web.1]: Rendered pages/home.html.erb within layouts/application (79.1ms) 
2012-06-30T23:05:36+00:00 app[web.1]: Completed 500 Internal Server Error in 108ms 
2012-06-30T23:05:36+00:00 app[web.1]: ActionView::Template::Error (can't convert Range into Integer): 
2012-06-30T23:05:36+00:00 app[web.1]: 
2012-06-30T23:05:36+00:00 app[web.1]:  1: <% provide(:title, 'Jason Mc Carthy | Fashion Photography Wedding Photography') %> 
2012-06-30T23:05:36+00:00 app[web.1]:  2: 
2012-06-30T23:05:36+00:00 app[web.1]:  3: <%= l 
anding_photo %> 
2012-06-30T23:05:36+00:00 app[web.1]:  4: 
2012-06-30T23:05:36+00:00 app[web.1]:  5: <span id="tagline">Endeavouring to build a creative &amp; inspiring 2D world</span> 
2012-06-30T23:05:36+00:00 app[web.1]: app/helpers/application_helper.rb:23:in `rand' 
2012-06-30T23:05:36+00:00 app[web.1]: app/helpers/application_helper.rb:23:in `landing_photo' 
2012-06-30T23:05:36+00:00 app[web.1]: app/views/pages/home.html.erb:3:in `_app_views_pages_home_html_erb__3704543374435589796_23990640' 
2012-06-30T23:05:36+00:00 app[web.1]: 
2012-06-30T23:05:36+00:00 app[web.1]: 
2012-06-30T23:05:36+00:00 heroku[router]: GET jasonmccarthy.ie/ dyno=web.1 queue=0 wait=0ms service=238ms status=500 bytes=643 
2012-06-30T23:05:36+00:00 heroku[nginx]: 194.46.182.60 - - [30/Jun/2012:23:05:36 +0000] "GET/HTTP/1.1" 500 643 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11" jasonmccarthy.ie 
2012-06-30T23:05:37+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2012-06-30T23:05:37+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2012-06-30T23:05:38+00:00 heroku[web.1]: Process exited with status 137 
2012-06-30T23:05:49+00:00 heroku[web.1]: State changed from up to starting 
2012-06-30T23:05:51+00:00 app[web.1]: 
2012-06-30T23:05:51+00:00 app[web.1]: 
2012-06-30T23:05:51+00:00 app[web.1]: Started GET "/" for 194.46.182.60 at 2012-06-30 23:05:51 +0000 
2012-06-30T23:05:51+00:00 app[web.1]: Processing by PagesController#home as HTML 
2012-06-30T23:05:51+00:00 app[web.1]: Rendered pages/home.html.erb within layouts/application (0.6ms) 
2012-06-30T23:05:51+00:00 app[web.1]: Completed 500 Internal Server Error in 1ms 
2012-06-30T23:05:51+00:00 app[web.1]: 
2012-06-30T23:05:51+00:00 app[web.1]: ActionView::Template::Error (can't convert Range into Integer): 
2012-06-30T23:05:51+00:00 app[web.1]:  2: 
2012-06-30T23:05:51+00:00 app[web.1]:  1: <% provide(:title, 'Jason Mc Carthy | Fashion Photography Wedding Photography') %> 
2012-06-30T23:05:51+00:00 app[web.1]:  3: <%= landing_photo %> 
2012-06-30T23:05:51+00:00 app[web.1]:  4: 
2012-06-30T23:05:51+00:00 app[web.1]:  5: <span id="tagline">Endeavouring to build a creative &amp; inspiring 2D world</span> 
2012-06-30T23:05:51+00:00 app[web.1]: app/helpers/application_helper.rb:23:in `rand' 
2012-06-30T23:05:51+00:00 app[web.1]: app/helpers/application_helper.rb:23:in `landing_photo' 
2012-06-30T23:05:51+00:00 app[web.1]: app/views/pages/home.html.erb:3:in `_app_views_pages_home_html_erb__3704543374435589796_23990640' 
2012-06-30T23:05:51+00:00 app[web.1]: 
2012-06-30T23:05:51+00:00 app[web.1]: 
2012-06-30T23:05:51+00:00 heroku[nginx]: 194.46.182.60 - - [30/Jun/2012:23:05:51 +0000] "GET/HTTP/1.1" 500 643 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11" jasonmccarthy.ie 
2012-06-30T23:05:51+00:00 heroku[router]: GET jasonmccarthy.ie/ dyno=web.1 queue=0 wait=0ms service=13ms status=500 bytes=643 
2012-06-30T23:05:52+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 23782` 
2012-06-30T23:05:52+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2012-06-30T23:05:53+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select' 
2012-06-30T23:05:53+00:00 app[web.1]: [2012-06-30 23:05:53] ERROR SignalException: SIGTERM 
2012-06-30T23:05:57+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) 
2012-06-30T23:05:57+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) 

應用助手:

def landing_photo 
    random = Random.rand(1..4) 
    image_tag "home-#{random}.png", {:class => 'bg'} 
end 

頁/家:

<%= landing_photo %> 
+0

的錯誤似乎是某種'landing_photo'方法中的轉換錯誤,以及我從日誌中可以看出的情況,它看起來像某種方式與某種隨機隨機發生器有關。試着看看你是否可以在本地重現它,或者可以在這裏放置一些代碼(例如'landing_photo'方法)。 – Frost

+0

@Frost好的,我添加了隨機函數代碼。這似乎很奇怪,這可能會導致一個問題,這個代碼在Heroku之前沒有被觸及,據我所知。 – colmtuite

回答

10

這可能是一個Ruby的版本問題,因爲random = Random.rand(1..4)作品在我的系統運行得很好MRI-1.9.3。也許雷電引起Heroku改變你的Ruby。也許你依靠現在已經停止的1.9.3實驗室插件。

檢查哪個版本你下與heroku run ruby -v運行,你可以迫使他們通過將以下在你的Gemfile頂部使用1.9.3:

source 'https://rubygems.org' 
ruby '1.9.3' 
+0

我認爲你在這裏的東西。當我將ruby版本添加到我的Gemfile時,我無法運行bundle。它返回一個錯誤。 – colmtuite

+0

ahh,我想你可能需要將你的捆綁版本升級到[1.2.0.pre](http://rubygems.org/gems/bundler/versions/1.2.0.pre) - 只要運行'gem install bundler - v 1.2.0.pre --pre' – stephenmurdoch

0

假設你沒有任何推新的代碼的Heroku是介紹了一些錯誤代碼。

我會檢查是否可以在本地重現錯誤。如果一切都很穩定,我會嘗試再次將您的最新代碼重新部署到heroku。

+0

本地一切都很好。我在停機期間推出了一些更改,更新了rails版本等。在嘗試更改任何內容之前,我試圖恢復到代碼的使用方式。我推了我最新的代碼,仍然不起作用。 – colmtuite

2

您對rand方法使用錯誤的參數,它只接受一個整數,而不是它們的範圍。

您正在尋找

random = Random.rand(4) 

你的另一種選擇是不使用隨機的,但是在使用Array#sample

random = (1..4).to_a.sample 
+1

.rand不接受MRI-1.9.3中的範圍,所以如果此代碼正常工作,那麼運行該應用程序的Ruby版本可能會發生某種變化。 – stephenmurdoch

相關問題