2012-01-27 32 views
1

我一直在讓我的應用程序在Heroku上運行時遇到了麻煩。我很確定這個問題來自我在應用程序中使用assetrecord和sqlite3的事實。Heroku Deploy Rails上的錯誤3.1.3

這是日誌的輸出;

2012-01-27T17:50:06+00:00 heroku[router]: GET stark-mountain-2291.heroku.com/ dyno=web.1   queue=0 wait=0ms service=3ms status=500 bytes=728 
2012-01-27T17:50:20+00:00 app[web.1]: 
2012-01-27T17:50:20+00:00 app[web.1]: 
2012-01-27T17:50:20+00:00 app[web.1]: Started GET "/" for 2.220.71.74 at 2012-01-27 09:50:20 -0800 
2012-01-27T17:50:20+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished): 
2012-01-27T17:50:20+00:00 app[web.1]: 
2012-01-27T17:50:20+00:00 app[web.1]: 
2012-01-27T17:50:20+00:00 app[web.1]: 
2012-01-27T17:50:20+00:00 heroku[router]: GET stark-mountain-2291.heroku.com/ dyno=web.1 queue=0 wait=0ms service=6ms status=500 bytes=728 
2012-01-27T17:50:20+00:00 app[web.1]: cache: [GET /] miss 
2012-01-27T17:50:20+00:00 app[web.1]: 
2012-01-27T17:51:08+00:00 heroku[slugc]: Slug compilation started 
2012-01-27T17:51:21+00:00 heroku[api]: Deploy 7b17242 by [email protected] 
2012-01-27T17:51:21+00:00 heroku[api]: Release v11 created by [email protected] 
2012-01-27T17:51:22+00:00 heroku[web.1]: State changed from up to bouncing 
2012-01-27T17:51:22+00:00 heroku[web.1]: State changed from bouncing to created 
2012-01-27T17:51:22+00:00 heroku[web.1]: State changed from created to starting 
2012-01-27T17:51:22+00:00 heroku[slugc]: Slug compilation finished 
2012-01-27T17:51:25+00:00 heroku[web.1]: Starting process with command `thin -p 52873 -e production -R /home/heroku_rack/heroku.ru start` 
2012-01-27T17:51:26+00:00 heroku[web.1]: Stopping process with SIGTERM 
2012-01-27T17:51:26+00:00 app[web.1]: >> Stopping ... 
2012-01-27T17:51:26+00:00 heroku[web.1]: Process exited 
2012-01-27T17:51:28+00:00 heroku[web.1]: State changed from starting to up 
2012-01-27T17:51:28+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious) 
2012-01-27T17:51:28+00:00 app[web.1]: >> Maximum connections set to 1024 
2012-01-27T17:51:28+00:00 app[web.1]: >> Listening on 0.0.0.0:52873, CTRL+C to stop 
2012-01-27T17:51:31+00:00 heroku[router]: GET stark-mountain-2291.heroku.com/ dyno=web.1 queue=0 wait=0ms service=141ms status=500 bytes=728 
2012-01-27T17:51:31+00:00 heroku[nginx]: 2.220.71.74 - - [27/Jan/2012:17:51:31 +0000] "GET/HTTP/1.1" 500 728 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7" stark-mountain- 2291.heroku.com 
2012-01-27T17:51:31+00:00 app[web.1]: 
2012-01-27T17:51:31+00:00 app[web.1]: 
2012-01-27T17:51:31+00:00 app[web.1]: Started GET "/" for 2.220.71.74 at 2012-01-27 09:51:31 -0800 
2012-01-27T17:51:31+00:00 app[web.1]: Processing by PagesController#home as HTML 
2012-01-27T17:51:31+00:00 app[web.1]: Rendered pages/home.html.erb within layouts/application (31.1ms) 
2012-01-27T17:51:31+00:00 app[web.1]: Completed 500 Internal Server Error in 82ms 
2012-01-27T17:51:31+00:00 app[web.1]: 
2012-01-27T17:51:31+00:00 app[web.1]: ActionView::Template::Error (application.css isn't precompiled): 
2012-01-27T17:51:31+00:00 app[web.1]:  11: <!-- END HTML5.js --> 
2012-01-27T17:51:31+00:00 app[web.1]:  12: 
2012-01-27T17:51:31+00:00 app[web.1]:  13: <!-- Load Assets --> 
2012-01-27T17:51:31+00:00 app[web.1]:  14: <%= stylesheet_link_tag "application" %> 
2012-01-27T17:51:31+00:00 app[web.1]: 
2012-01-27T17:51:31+00:00 app[web.1]: cache: [GET /] miss 
2012-01-27T17:51:31+00:00 app[web.1]:  17: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js" type="text/javascript"></script> 
2012-01-27T17:51:31+00:00 app[web.1]:  16: <%= javascript_include_tag "jquery- 1.7.1.min.js" %> 
2012-01-27T17:51:31+00:00 app[web.1]:  15: <%= javascript_include_tag "pixel" %> 
2012-01-27T17:51:31+00:00 app[web.1]: app/views/layouts/application.html.erb:14:in `_app_views_layouts_application_html_erb___1055267037675301688_25854420' 
2012-01-27T17:51:31+00:00 app[web.1]: 
2012-01-27T17:52:07+00:00 heroku[slugc]: Slug compilation started 
2012-01-27T17:52:20+00:00 heroku[web.1]: State changed from up to bouncing 
2012-01-27T17:52:20+00:00 heroku[web.1]: State changed from bouncing to created 
2012-01-27T17:52:20+00:00 heroku[web.1]: State changed from created to starting 
2012-01-27T17:52:20+00:00 heroku[api]: Deploy c5f2759 by [email protected] 
2012-01-27T17:52:20+00:00 heroku[api]: Release v12 created by [email protected] 
2012-01-27T17:52:20+00:00 heroku[slugc]: Slug compilation finished 
2012-01-27T17:52:23+00:00 heroku[web.1]: Starting process with command `thin -p 51747 -e production -R /home/heroku_rack/heroku.ru start` 
2012-01-27T17:52:23+00:00 heroku[web.1]: Stopping process with SIGTERM 
2012-01-27T17:52:23+00:00 app[web.1]: >> Stopping ... 
2012-01-27T17:52:23+00:00 heroku[web.1]: Process exited 
2012-01-27T17:52:27+00:00 app[web.1]: >> Maximum connections set to 1024 
2012-01-27T17:52:27+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious) 
2012-01-27T17:52:27+00:00 app[web.1]: >> Listening on 0.0.0.0:51747, CTRL+C to stop 
2012-01-27T17:52:27+00:00 heroku[web.1]: State changed from starting to up 
2012-01-27T17:57:12+00:00 heroku[slugc]: Slug compilation started 
2012-01-27T17:57:24+00:00 heroku[api]: Deploy e875fca by [email protected] 
2012-01-27T17:57:24+00:00 heroku[api]: Release v13 created by [email protected] 
2012-01-27T17:57:25+00:00 heroku[slugc]: Slug compilation finished 
2012-01-27T17:57:24+00:00 heroku[web.1]: State changed from up to bouncing 
2012-01-27T17:57:24+00:00 heroku[web.1]: State changed from bouncing to created 
2012-01-27T17:57:24+00:00 heroku[web.1]: State changed from created to starting 
2012-01-27T17:57:27+00:00 heroku[web.1]: Starting process with command `thin -p 17421 -e production -R /home/heroku_rack/heroku.ru start` 
2012-01-27T17:57:28+00:00 heroku[web.1]: Stopping process with SIGTERM 
2012-01-27T17:57:28+00:00 app[web.1]: >> Stopping ... 
2012-01-27T17:57:28+00:00 heroku[web.1]: Process exited 
2012-01-27T17:57:32+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious) 
2012-01-27T17:57:32+00:00 app[web.1]: >> Maximum connections set to 1024 
2012-01-27T17:57:32+00:00 app[web.1]: >> Listening on 0.0.0.0:17421, CTRL+C to stop 
2012-01-27T17:57:33+00:00 heroku[web.1]: State changed from starting to up 
2012-01-27T18:00:10+00:00 heroku[slugc]: Slug compilation started 
2012-01-27T18:00:22+00:00 heroku[api]: Deploy 3e62952 by [email protected] 
2012-01-27T18:00:22+00:00 heroku[api]: Release v14 created by [email protected] 
2012-01-27T18:00:23+00:00 heroku[web.1]: State changed from up to bouncing 
2012-01-27T18:00:23+00:00 heroku[web.1]: State changed from bouncing to created 
2012-01-27T18:00:23+00:00 heroku[web.1]: State changed from created to starting 
2012-01-27T18:00:23+00:00 heroku[slugc]: Slug compilation finished 
2012-01-27T18:00:26+00:00 heroku[web.1]: Starting process with command `thin -p 16125 -e production -R /home/heroku_rack/heroku.ru start` 
2012-01-27T18:00:29+00:00 app[web.1]: >> Maximum connections set to 1024 
2012-01-27T18:00:29+00:00 app[web.1]: >> Listening on 0.0.0.0:16125, CTRL+C to stop 
2012-01-27T18:00:29+00:00 app[web.1]: >> Thin web server (v1.2.6 codename Crazy Delicious) 
2012-01-27T18:00:30+00:00 heroku[web.1]: State changed from starting to up 
2012-01-27T18:00:34+00:00 app[web.1]: 
2012-01-27T18:00:34+00:00 app[web.1]: 
2012-01-27T18:00:34+00:00 app[web.1]: Started GET "/" for 2.220.71.74 at 2012-01-27 10:00:34 -0800 
2012-01-27T18:00:34+00:00 app[web.1]: 
2012-01-27T18:00:34+00:00 app[web.1]: cache: [GET /] miss 
2012-01-27T18:00:34+00:00 app[web.1]: 
2012-01-27T18:00:34+00:00 app[web.1]: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished): 
2012-01-27T18:00:34+00:00 app[web.1]: 
2012-01-27T18:00:34+00:00 app[web.1]: 
2012-01-27T18:00:34+00:00 heroku[router]: GET stark-mountain-2291.heroku.com/ dyno=web.1 queue=0 wait=0ms service=497ms status=500 bytes=728 
2012-01-27T18:00:34+00:00 heroku[nginx]: 2.220.71.74 - - [27/Jan/2012:18:00:34 +0000] "GET/HTTP/1.1" 500 728 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7" stark-mountain-2291.heroku.com 

這是我的gemfile;

group :development do 
    gem 'sqlite3-ruby', :require => 'sqlite3' 
    gem 'rspec-rails' 
end 

group :test do 
    gem 'rspec' 
    gem 'webrat' 
end` 

我的application.rb中

# Pick the frameworks you want: 
require "active_record/railtie" 
require "action_controller/railtie" 
require "action_mailer/railtie" 
require "active_resource/railtie" 
require "sprockets/railtie" 
# require "rails/test_unit/railtie"` 

我也想加入這個我production.rb

# Fallback to assets pipeline if a precompiled asset is missed 
    config.assets.compile = true 

如果任何人都可以點我在正確的方向爲這一點,將是真棒!

對不起,如果我留下任何東西,我還是新鮮的!

非常感謝

克里斯:)

回答

1

我想通過將應用程序部署到雪松堆棧(支持的Rails 3.1的應用程序)開始 - 它看起來並不像你從你的記錄做。確保你做到了;

heroku create --stack cedar 

當你創建你的應用程序。另外,你不能在Heroku上使用sqlite3,你需要將它移到Gemfile的開發組中,並添加一個包含pg,bundle的生產組,然後將Gemfile和Gemfile.lock推送到Heroku。

+0

謝謝John!將pg添加到生產組似乎已經對它進行了排序,並且還創建了一個帶有雪松堆疊的新的herkou應用程序。輝煌! :) – 2012-01-27 22:40:38