2012-04-01 204 views
3

所以,我只是站了一個全新的Rails 3.1.1應用程序(Ruby 1.8.7)。Rails 3.1 + Heroku =工作人員崩潰

在那裏放幾個腳手架,安裝Authlogic,並創建一個新的Heroku應用程序。推到Heroku並遷移數據庫。

而且一切都很好。我可以使用Authlogic創建新的用戶帳戶,並在Heroku的模型中創建新記錄。

雖然有趣的事情。如果我將'工作人員dynos'從零增加到任何事情,heroku日誌顯示那些試圖啓動並且崩潰的工作人員。

但是,我沒有延遲招聘安裝。而從未實行延時工作到這個程序

我還沒有推出比Twilio或任何先進的代碼以外的任何「高級」的寶石。這只是具有authlogic的新rails應用程序。沒有新的耙子任務。其他

一個注意:在我的本地開發機器,我試圖在不同的應用程式安裝延時工作了一段時間回來和失敗。延遲工作的'鬼魂'會困擾這個新的應用程序嗎?

謝謝!下面

代碼.....

Heroku的日誌後,我增加網站工作人員從0 - > 2.

2012-04-01T11:44:04+00:00 heroku[api]: Scale to web=1, worker=2 by [email protected] 
2012-04-01T11:44:07+00:00 heroku[worker.2]: Starting process with command `bundle exec rake jobs:work` 
2012-04-01T11:44:07+00:00 heroku[worker.1]: Starting process with command `bundle exec  rake jobs:work` 
2012-04-01T11:44:08+00:00 heroku[worker.2]: State changed from starting to up 
2012-04-01T11:44:08+00:00 heroku[worker.1]: State changed from starting to up 
2012-04-01T11:44:11+00:00 app[worker.2]: rake aborted! 
2012-04-01T11:44:11+00:00 app[worker.2]: Don't know how to build task 'jobs:work' 
2012-04-01T11:44:11+00:00 app[worker.2]: 
2012-04-01T11:44:11+00:00 app[worker.2]: (See full trace by running task with --trace) 
2012-04-01T11:44:12+00:00 heroku[worker.2]: Process exited with status 1 
2012-04-01T11:44:12+00:00 heroku[worker.2]: State changed from up to crashed 
2012-04-01T11:44:12+00:00 heroku[worker.2]: State changed from crashed to created 
2012-04-01T11:44:12+00:00 heroku[worker.2]: State changed from created to starting 
2012-04-01T11:44:13+00:00 app[worker.1]: rake aborted! 
2012-04-01T11:44:13+00:00 app[worker.1]: Don't know how to build task 'jobs:work' 
2012-04-01T11:44:13+00:00 app[worker.1]: 
2012-04-01T11:44:13+00:00 app[worker.1]: (See full trace by running task with --trace) 
2012-04-01T11:44:14+00:00 heroku[worker.1]: Process exited with status 1 
2012-04-01T11:44:14+00:00 heroku[worker.1]: State changed from up to crashed 
2012-04-01T11:44:14+00:00 heroku[worker.1]: State changed from crashed to created 
2012-04-01T11:44:14+00:00 heroku[worker.1]: State changed from created to starting 
2012-04-01T11:44:16+00:00 heroku[worker.2]: Starting process with command `bundle exec rake jobs:work` 
2012-04-01T11:44:17+00:00 heroku[worker.2]: State changed from starting to up 
2012-04-01T11:44:18+00:00 heroku[worker.1]: Starting process with command `bundle exec rake jobs:work` 
2012-04-01T11:44:19+00:00 heroku[worker.1]: State changed from starting to up 
2012-04-01T11:44:20+00:00 app[worker.2]: rake aborted! 
2012-04-01T11:44:20+00:00 app[worker.2]: Don't know how to build task 'jobs:work' 
2012-04-01T11:44:20+00:00 app[worker.2]: 
2012-04-01T11:44:20+00:00 app[worker.2]: (See full trace by running task with --trace) 
2012-04-01T11:44:22+00:00 heroku[worker.2]: Process exited with status 1 
2012-04-01T11:44:22+00:00 heroku[worker.2]: State changed from up to crashed 
2012-04-01T11:44:22+00:00 app[worker.1]: rake aborted! 
2012-04-01T11:44:22+00:00 app[worker.1]: Don't know how to build task 'jobs:work' 
2012-04-01T11:44:22+00:00 app[worker.1]: 
2012-04-01T11:44:22+00:00 app[worker.1]: (See full trace by running task with --trace) 
2012-04-01T11:44:23+00:00 heroku[worker.1]: Process exited with status 1 
2012-04-01T11:44:23+00:00 heroku[worker.1]: State changed from up to crashed 

Gemfile.lock的

GEM 
    remote: http://rubygems.org/ 
    specs: 
    actionmailer (3.1.1) 
     actionpack (= 3.1.1) 
     mail (~> 2.3.0) 
    actionpack (3.1.1) 
     activemodel (= 3.1.1) 
     activesupport (= 3.1.1) 
     builder (~> 3.0.0) 
     erubis (~> 2.7.0) 
     i18n (~> 0.6) 
     rack (~> 1.3.2) 
     rack-cache (~> 1.1) 
     rack-mount (~> 0.8.2) 
     rack-test (~> 0.6.1) 
     sprockets (~> 2.0.2) 
    activemodel (3.1.1) 
     activesupport (= 3.1.1) 
     builder (~> 3.0.0) 
     i18n (~> 0.6) 
    activerecord (3.1.1) 
     activemodel (= 3.1.1) 
     activesupport (= 3.1.1) 
     arel (~> 2.2.1) 
     tzinfo (~> 0.3.29) 
    activeresource (3.1.1) 
     activemodel (= 3.1.1) 
     activesupport (= 3.1.1) 
    activesupport (3.1.1) 
     multi_json (~> 1.0) 
    addressable (2.2.7) 
    arel (2.2.3) 
    authlogic (3.1.0) 
     activerecord (>= 3.0.7) 
     activerecord (>= 3.0.7) 
    builder (3.0.0) 
    coffee-rails (3.1.1) 
     coffee-script (>= 2.2.0) 
     railties (~> 3.1.0) 
    coffee-script (2.2.0) 
     coffee-script-source 
     execjs 
    coffee-script-source (1.2.0) 
    erubis (2.7.0) 
    execjs (1.3.0) 
     multi_json (~> 1.0) 
    heroku (2.23.0) 
     launchy (>= 0.3.2) 
     netrc (~> 0.7.1) 
     rest-client (~> 1.6.1) 
     rubyzip 
    hike (1.2.1) 
    i18n (0.6.0) 
    jquery-rails (1.0.16) 
     railties (~> 3.0) 
     thor (~> 0.14) 
    json (1.5.1) 
    launchy (2.1.0) 
     addressable (~> 2.2.6) 
    mail (2.3.3) 
     i18n (>= 0.4.0) 
     mime-types (~> 1.16) 
     treetop (~> 1.4.8) 
    mime-types (1.18) 
    multi_json (1.2.0) 
    netrc (0.7.1) 
    pg (0.13.2) 
    polyglot (0.3.3) 
    rack (1.3.6) 
    rack-cache (1.2) 
     rack (>= 0.4) 
    rack-mount (0.8.3) 
     rack (>= 1.0.0) 
    rack-ssl (1.3.2) 
     rack 
    rack-test (0.6.1) 
     rack (>= 1.0) 
    rails (3.1.1) 
     actionmailer (= 3.1.1) 
     actionpack (= 3.1.1) 
     activerecord (= 3.1.1) 
     activeresource (= 3.1.1) 
     activesupport (= 3.1.1) 
     bundler (~> 1.0) 
     railties (= 3.1.1) 
    railties (3.1.1) 
     actionpack (= 3.1.1) 
     activesupport (= 3.1.1) 
     rack-ssl (~> 1.3.2) 
     rake (>= 0.8.7) 
     rdoc (~> 3.4) 
     thor (~> 0.14.6) 
    rake (0.9.2.2) 
    rdoc (3.12) 
     json (~> 1.4) 
    rest-client (1.6.7) 
     mime-types (>= 1.16) 
    rubyzip (0.9.4) 
    sass (3.1.15) 
    sass-rails (3.1.4) 
     actionpack (~> 3.1.0) 
     railties (~> 3.1.0) 
     sass (>= 3.1.4) 
     sprockets (~> 2.0.0) 
     tilt (~> 1.3.2) 
    sequel (3.20.0) 
    sinatra (1.0) 
     rack (>= 1.0) 
    sprockets (2.0.3) 
     hike (~> 1.2) 
     rack (~> 1.0) 
     tilt (~> 1.1, != 1.3.0) 
    sqlite3 (1.3.4) 
    sqlite3-ruby (1.3.3) 
     sqlite3 (>= 1.3.3) 
    taps (0.3.23) 
     rack (>= 1.0.1) 
     rest-client (>= 1.4.0, < 1.7.0) 
     sequel (~> 3.20.0) 
     sinatra (~> 1.0.0) 
     sqlite3-ruby (~> 1.2) 
    thor (0.14.6) 
    tilt (1.3.3) 
    treetop (1.4.10) 
     polyglot 
     polyglot (>= 0.3.1) 
    twiliolib (2.0.7) 
     builder (>= 2.1.2) 
    tzinfo (0.3.32) 
    uglifier (1.2.4) 
     execjs (>= 0.3.0) 
     multi_json (>= 1.0.2) 

PLATFORMS 
    ruby 

DEPENDENCIES 
    authlogic 
    coffee-rails (~> 3.1.1) 
    heroku 
    jquery-rails 
    json 
    pg 
    rails (= 3.1.1) 
    sass-rails (~> 3.1.4) 
    sqlite3 
    taps 
    twiliolib 
    uglifier (>= 1.0.3) 

Heroku的推寶石上市

-----> Heroku receiving push 
-----> Ruby/Rails app detected 
-----> Detected Rails is not set to serve static_assets 
     Installing rails3_serve_static_assets... done 
-----> Configure Rails 3 to disable x-sendfile 
     Installing rails3_disable_x_sendfile... done 
-----> Configure Rails to log to stdout 
     Installing rails_log_stdout... done 
-----> Gemfile detected, running Bundler version 1.0.7 
     Unresolved dependencies detected; Installing... 
     Using --without development:test 
     Fetching source index for http://rubygems.org/ 
     Installing rake (0.9.2.2) 
     Installing multi_json (1.2.0) 
     Installing activesupport (3.1.1)  
     Installing builder (3.0.0) 
     Installing i18n (0.6.0) 
     Installing activemodel (3.1.1) 
     Installing erubis (2.7.0) 
     Installing rack (1.3.6) 
     Installing rack-cache (1.2) 
     Installing rack-mount (0.8.3) 
     Installing rack-test (0.6.1) 
     Installing hike (1.2.1) 
     Installing tilt (1.3.3) 
     Installing sprockets (2.0.3) 
     Installing actionpack (3.1.1) 
     Installing mime-types (1.18) 
     Installing polyglot (0.3.3) 
     Installing treetop (1.4.10) 
     Installing mail (2.3.3) 
     Installing actionmailer (3.1.1) 
     Installing arel (2.2.3) 
     Installing tzinfo (0.3.32) 
     Installing activerecord (3.1.1) 
     Installing activeresource (3.1.1) 
     Installing addressable (2.2.7) 
     Installing authlogic (3.1.0) 
     Installing coffee-script-source (1.2.0) 
     Installing execjs (1.3.0) 
     Installing coffee-script (2.2.0) 
     Installing rack-ssl (1.3.2) 
     Installing json (1.5.1) with native extensions 
     Installing rdoc (3.12) 
     Installing thor (0.14.6) 
     Installing railties (3.1.1) 
     Installing coffee-rails (3.1.1) 
     Installing launchy (2.1.0) 
     Installing netrc (0.7.1) 
     Installing rest-client (1.6.7) 
     Installing rubyzip (0.9.4) 
     Installing heroku (2.23.0) 
     Installing jquery-rails (1.0.16) 
     Installing pg (0.13.2) with native extensions 
     Using bundler (1.0.7) 
     Installing rails (3.1.1) 
     Installing sass (3.1.15) 
     Installing sass-rails (3.1.4) 
     Installing sequel (3.20.0) 
     Installing sinatra (1.0) 
     Installing sqlite3 (1.3.4) with native extensions 
     Installing sqlite3-ruby (1.3.3) 
     Installing taps (0.3.23) 
     Installing twiliolib (2.0.7) 
     Installing uglifier (1.2.4) 
     Your bundle is complete! It was installed into ./.bundle/gems/ 
-----> Compiled slug size is 7.8MB 
-----> Launching... done, v4 

heroku stack yield this:

aspen-mri-1.8.6 
* bamboo-mri-1.9.2 
    bamboo-ree-1.8.7 
    cedar (beta) 

回答

4

工人dynos專門用於延遲作業任務。

如果不推遲安裝工作,那麼你不應該縮放你的工人數量(這是需要DJ喬布斯護理)。

如果你的意思是縮放你的網頁動態鏈接,那麼簡單地縮放web = 2或任何你想要的。

我猜你的錯誤是因爲你的新縮放DJ工人無法找到任何工作要做,而且出現了錯誤。

Scale worker = 0,看看是否修復它。

如果你想擴展您的網絡DYNOS獲得更好的性能,網絡是你在找什麼。

有關Heroku測功機類型的更多文檔:https://devcenter.heroku.com/articles/scaling

+0

感謝您的幫助! – DougN 2012-04-04 13:44:42