2011-09-18 140 views
5

我一直在試圖找出日誌中出了什麼問題,但不知道如何解決它。以下是日誌中的片段,我對如何修復有些困惑。任何幫助將不勝感激。Rails應用程序在本地工作,在Heroku上崩潰

Could not load SystemTimer >= v1.2.0. Falling back to timeout.rb. SystemTimer is STRONGLY recommended for timeouts in Ruby 1.8.7. See http://ph7spot.com/blog/system-timer-1-2-release for details. 

/app/.bundle/gems/ruby/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:306:in `depend_on': No such file to load -- spec_helper (LoadError) 

,這是在日誌

from /app/.bundle/gems/ruby/1.8/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers' 

根據捆綁的,下面的寶石正在使用

據包安裝的頂部,下面的寶石被安裝

使用rake(0.9.2) 使用摘要(1.0.0) 使用activesupport(3.0.3) 使用構建器使用I18N(2.1.2) 使用activemodel的(0.6.0) 使用erubis(3.0.3) (2.6.6) 使用齒條(1.2.4) 使用機架式(0.6.14) 使用齒條 - 試驗(0.5.7) 使用tzinfo(0.3.29) 使用ActionPack的(3.0.3) 使用MIME類型(1.16) 使用多語種(0.3.2) 使用樹梢(1.4.10) 使用郵件使用的ActionMailer(2.2.19) 使用AREL(3.0.3) 使用ActiveRecord(2.0.10) 使用的ActiveResource(3.0.3) 使用BSON(3.0.3) (1.3.1) 使用bson_ext(1.3 0.1) 使用捆綁(1.0.18) 使用carrierwave(0.5.7) 使用EXCON(0.6.6) 使用formatador(0.2.1) 使用multi_json(1.0.3) 使用net-SSH(2.1.4) 使用net-SCP(1.0.4) 使用引入nokogiri(1.5.0) 使用紅寶石-HMAC(0.4.0) 使用霧(0.11.0) 使用formtastic(1.2.4) 使用蒙戈(1.3。 1) 使用勇敢(0.3.8) 使用mongo_mapper(0.9.2) 使用托爾(0.14.6) 使用railties(3.0.3) 使用導軌(3.0.3) 使用Rails3中發電機(0.17。 4)

下面是完整的Heroku的日誌

2011-09-19T00:19:53+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers' 
2011-09-19T00:19:53+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!' 
2011-09-19T00:19:53+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing' 
2011-09-19T00:19:53+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>' 
2011-09-19T00:19:53+00:00 app[web.1]: from <internal:lib/rubygems/custom_require>:29:in `require' 
2011-09-19T00:19:53+00:00 app[web.1]: from <internal:lib/rubygems/custom_require>:29:in `require' 
2011-09-19T00:19:53+00:00 app[web.1]: from config.ru:3:in `block (3 levels) in <main>' 
2011-09-19T00:19:53+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:23:in `eval' 
2011-09-19T00:19:53+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:23:in `block (3 levels) in <main>' 
2011-09-19T00:19:53+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval' 
2011-09-19T00:19:53+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize' 
2011-09-19T00:19:53+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:63:in `new' 
2011-09-19T00:19:53+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:63:in `map' 
2011-09-19T00:19:53+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:18:in `block (2 levels) in <main>' 
2011-09-19T00:19:53+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval' 
2011-09-19T00:19:53+00:00 heroku[web.1]: Process exited 
2011-09-19T00:19:53+00:00 heroku[web.1]: State changed from starting to crashed 
2011-09-19T00:31:24+00:00 heroku[web.1]: State changed from crashed to created 
2011-09-19T00:31:24+00:00 heroku[web.1]: State changed from created to starting 
2011-09-19T00:31:27+00:00 heroku[web.1]: Starting process with command `thin -p 42871 -e production -R /home/heroku_rack/heroku.ru start` 
2011-09-19T00:31:31+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:304:in `rescue in depend_on': No such file to load -- spec_helper (LoadError) 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:299:in `depend_on' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:216:in `require_dependency' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:138:in `block (2 levels) in eager_load!' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:137:in `each' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:137:in `block in eager_load!' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:135:in `each' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:135:in `eager_load!' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:108:in `eager_load!' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application/finisher.rb:41:in `block in <module:Finisher>' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing' 
2011-09-19T00:31:31+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>' 
2011-09-19T00:31:31+00:00 app[web.1]: from <internal:lib/rubygems/custom_require>:29:in `require' 
2011-09-19T00:31:31+00:00 app[web.1]: from <internal:lib/rubygems/custom_require>:29:in `require' 
2011-09-19T00:31:31+00:00 app[web.1]: from config.ru:3:in `block (3 levels) in <main>' 
2011-09-19T00:31:31+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:23:in `eval' 
2011-09-19T00:31:31+00:00 heroku[web.1]: Process exited 
2011-09-19T00:31:32+00:00 heroku[web.1]: State changed from starting to crashed 
2011-09-19T00:40:49+00:00 heroku[slugc]: Slug compilation started 
2011-09-19T00:40:59+00:00 heroku[api]: Deploy 50313f5 by [email protected] 
2011-09-19T00:40:59+00:00 heroku[api]: Release v5 created by [email protected] 
2011-09-19T00:40:59+00:00 heroku[web.1]: State changed from crashed to created 
2011-09-19T00:40:59+00:00 heroku[web.1]: State changed from created to starting 
2011-09-19T00:41:00+00:00 heroku[slugc]: Slug compilation finished 
2011-09-19T00:41:02+00:00 heroku[web.1]: Starting process with command `thin -p 22238 -e production -R /home/heroku_rack/heroku.ru start` 
2011-09-19T00:41:06+00:00 app[web.1]: /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:304:in `rescue in depend_on': No such file to load -- spec_helper (LoadError) 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:299:in `depend_on' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:216:in `require_dependency' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:138:in `block (2 levels) in eager_load!' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:137:in `each' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:137:in `block in eager_load!' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:135:in `each' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:135:in `eager_load!' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:108:in `eager_load!' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application/finisher.rb:41:in `block in <module:Finisher>' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>' 
2011-09-19T00:41:06+00:00 app[web.1]: from <internal:lib/rubygems/custom_require>:29:in `require' 
2011-09-19T00:41:06+00:00 app[web.1]: from <internal:lib/rubygems/custom_require>:29:in `require' 
2011-09-19T00:41:06+00:00 app[web.1]: from config.ru:3:in `block (3 levels) in <main>' 
2011-09-19T00:41:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:23:in `eval' 
2011-09-19T00:41:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:23:in `block (3 levels) in <main>' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:63:in `new' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:63:in `map' 
2011-09-19T00:41:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:18:in `block (2 levels) in <main>' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize' 
2011-09-19T00:41:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:11:in `new' 
2011-09-19T00:41:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:11:in `block in <main>' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval' 
2011-09-19T00:41:06+00:00 app[web.1]: from /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize' 
2011-09-19T00:41:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:1:in `new' 
2011-09-19T00:41:06+00:00 app[web.1]: from /home/heroku_rack/heroku.ru:1:in `<main>' 
2011-09-19T00:41:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `eval' 
2011-09-19T00:41:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/rack/adapter/loader.rb:36:in `load' 
2011-09-19T00:41:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:175:in `load_rackup_config' 
2011-09-19T00:41:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/controllers/controller.rb:65:in `start' 
2011-09-19T00:41:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:177:in `run_command' 
2011-09-19T00:41:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/lib/thin/runner.rb:143:in `run!' 
2011-09-19T00:41:06+00:00 app[web.1]: from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/thin-1.2.6/bin/thin:6:in `<top (required)>' 
2011-09-19T00:41:06+00:00 app[web.1]: from /usr/ruby1.9.2/bin/thin:19:in `load' 
2011-09-19T00:41:06+00:00 app[web.1]: from /usr/ruby1.9.2/bin/thin:19:in `<main>' 
2011-09-19T00:41:06+00:00 heroku[web.1]: Process exited 
2011-09-19T00:41:07+00:00 heroku[web.1]: State changed from starting to crashed 

謝謝!

+0

你是如何解決這個問題的? –

+0

你有沒有解決這個問題? – Jaqx

+0

是的,我不記得確切的解決方案,但我相信它是固定的,當我指定了我想要的確切寶石版本(heroku有較新的不兼容版本) – Kyle

回答

0

我想問題可能是在這一行:

/app/.bundle/gems/ruby/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:306:in `depend_on': No such file to load -- spec_helper (LoadError) 

看來你的初始化的一箇中有require "spec_helper"(或其他地方,做同樣的加載文件),不應該。這可能與:test組中的Gemfile中的寶石有關,這些寶石默認情況下不會在Heroku中加載。

您可以嘗試在本地運行bundle install --without test development來重現Heroku如何安裝寶石。請注意,這將是捆綁安裝寶石的永久方式,直到您從您的項目中刪除./.bundle/config文件,所以您一旦想出來之後就會想要這樣做。

希望這有助於...

+0

我無法找到任何需要「spec_helper」初始化程序:(我沒有捆綁安裝 - 沒有測試開發,也沒有發生錯誤 – Kyle

+0

應用程序在本地運行,但仍然失敗heroku – Kyle

+0

@Kyle之後,你應該執行你的命令(比如'rails s '''rails c','rake something'),用'bundle exec'作爲前綴,這樣就完全複製了heroku env,否則你的命令仍然會看到「已卸載」的gems。 – Fabio

2

我有同樣的事情。在開發過程中,一個spec不知何故被複制到控制器文件夾中。本地沒有任何影響,但墜毀雪松...

+0

我認爲你需要清楚你的問題以簡單way.otherwise你的問題他解釋創建另一個問題 – khan

+0

我只是花了大量的時間試圖追查下來,你的答案解決了我的問題。我結束了搜索「spec_helper」的應用程序,發現我不小心將一個規格文件保存在模型文件夾中。 – nfriend21

-1

與乘客有同樣的問題。問題是依賴於lib的模型中的一個要求。將lib目錄添加到自動加載並刪除全部需要(通過fgrep 'require' -r app/找到)工作。

相關問題