Heroku Deploy Rails上的错误3.1.3

时间:2012-01-27 18:14:34

标签: heroku

我一直无法让我的应用程序在Heroku上运行。我很确定问题来自于我在我的应用程序中使用assetrecord和sqlite3的事实。

这是日志的输出;

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 devilstar1987@gmail.com
2012-01-27T17:51:21+00:00 heroku[api]: Release v11 created by devilstar1987@gmail.com
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 devilstar1987@gmail.com
2012-01-27T17:52:20+00:00 heroku[api]: Release v12 created by devilstar1987@gmail.com
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 devilstar1987@gmail.com
2012-01-27T17:57:24+00:00 heroku[api]: Release v13 created by devilstar1987@gmail.com
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 devilstar1987@gmail.com
2012-01-27T18:00:22+00:00 heroku[api]: Release v14 created by devilstar1987@gmail.com
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 个答案:

答案 0 :(得分:1)

我首先将您的应用程序部署到Cedar堆栈(它支持Rails 3.1应用程序) - 它看起来与您的日志不同。确保你这样做;

heroku create --stack cedar

创建应用程序时。另外,你不能在Heroku上使用sqlite3,你需要将它移动到Gemfile中的开发组中,并添加一个包含pg,bundle的生产组,然后将Gemfile和Gemfile.lock推送到Heroku。