2013-01-14 341 views
1

我的rails應用程序在localhost中工作正常,但未能在heroku上部署。我搜索了/試圖找到與資產預編譯有關的原因(例如:heroku運行rake資產:預編譯),但顯然這些方法似乎沒有給出任何積極的結果。rails heroku部署錯誤:預編譯資產

這裏是Heroku的日誌

``2013-01-13T23:21:36+00:00 app[web.1]:   Called from: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'. 
2013-01-13T23:21:36+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2013-01-13T23:21:36+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2013-01-13T23:21:37+00:00 app[web.1]: [2013-01-13 23:21:37] INFO WEBrick 1.3.1 
2013-01-13T23:21:37+00:00 app[web.1]: [2013-01-13 23:21:37] INFO WEBrick::HTTPServer#start: pid=2 port=17458 
2013-01-13T23:21:37+00:00 app[web.1]: [2013-01-13 23:21:37] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] 
2013-01-13T23:21:37+00:00 heroku[web.1]: State changed from starting to up 
2013-01-13T23:21:38+00:00 heroku[web.1]: Process exited with status 137 
2013-01-13T23:21:39+00:00 app[web.1]: 
2013-01-13T23:21:39+00:00 app[web.1]: 
2013-01-13T23:21:39+00:00 app[web.1]: => Call with -d to detach 
2013-01-13T23:21:39+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:17458 
2013-01-13T23:21:39+00:00 app[web.1]: => Booting WEBrick 
2013-01-13T23:21:39+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-01-13T23:21:39+00:00 app[web.1]: Started GET "/" for 81.83.230.107 at 2013-01-13 23:21:39 +0000 
2013-01-13T23:21:39+00:00 app[web.1]: Connecting to database specified by DATABASE_URL 
2013-01-13T23:21:39+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2013-01-13T23:21:39+00:00 app[web.1]: Rendered static_pages/home.html within layouts/application (29.9ms) 
2013-01-13T23:21:39+00:00 app[web.1]: Completed 500 Internal Server Error in 73ms 
2013-01-13T23:21:39+00:00 app[web.1]:  6: <%= stylesheet_link_tag "bootstrap-responsive", :media => "all" %> 
2013-01-13T23:21:39+00:00 heroku[router]: at=info method=GET path=/ host=safe-plateau-7008.herokuapp.com fwd=81.83.230.107 dyno=web.1 queue=0 wait=0ms connect=1ms service=869ms status=500 bytes=643 
2013-01-13T23:21:39+00:00 app[web.1]: ActionView::Template::Error (bootstrap-responsive.css isn't precompiled): 
2013-01-13T23:21:39+00:00 app[web.1]:  3: <head> 
2013-01-13T23:21:39+00:00 app[web.1]: 
2013-01-13T23:21:39+00:00 app[web.1]:  5: <%= stylesheet_link_tag "application", :media => "all" %> 
2013-01-13T23:21:39+00:00 app[web.1]:  9: 
2013-01-13T23:21:39+00:00 app[web.1]:  4: <title>Leanbrewsite</title> 
2013-01-13T23:21:39+00:00 app[web.1]:  7: <%= javascript_include_tag "application" %> 
2013-01-13T23:21:39+00:00 app[web.1]: app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___3282064974730572949_33935860' 
2013-01-13T23:21:39+00:00 app[web.1]: 
2013-01-13T23:21:39+00:00 app[web.1]: 
2013-01-13T23:21:39+00:00 app[web.1]:  8: <%= csrf_meta_tags %> 
2013-01-13T23:26:47+00:00 heroku[slugc]: Slug compilation started 
2013-01-13T23:27:04+00:00 heroku[api]: Release v13 created by [email protected] 
2013-01-13T23:27:04+00:00 heroku[api]: Deploy 197fc85 by [email protected] 
2013-01-13T23:27:04+00:00 heroku[web.1]: State changed from up to starting 
2013-01-13T23:27:05+00:00 heroku[slugc]: Slug compilation finished 
2013-01-13T23:27:07+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2013-01-13T23:27:08+00:00 app[web.1]: [2013-01-13 23:27:08] ERROR SignalException: SIGTERM 
2013-01-13T23:27:08+00:00 app[web.1]: /usr/local/lib/ruby/1.9.1/webrick/server.rb:90:in `select' 
2013-01-13T23:27:11+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 56864` 
2013-01-13T23:27:18+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2013-01-13T23:27:18+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2013-01-13T23:27:18+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) 
2013-01-13T23:27:18+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) 
2013-01-13T23:27:20+00:00 heroku[web.1]: Process exited with status 137 
2013-01-13T23:27:23+00:00 app[web.1]:   SECURITY WARNING: No secret option provided to Rack::Session::Cookie. 
2013-01-13T23:27:23+00:00 app[web.1]:   This poses a security threat. It is strongly recommended that you 
2013-01-13T23:27:23+00:00 app[web.1]:   provide a secret to prevent exploits that may be possible from crafted 
2013-01-13T23:27:23+00:00 app[web.1]:   cookies. This will not be supported in future versions of Rack, and 
2013-01-13T23:27:23+00:00 app[web.1]: 
2013-01-13T23:27:23+00:00 app[web.1]:   future versions will even invalidate your existing user cookies. 
2013-01-13T23:27:23+00:00 app[web.1]:   Called from: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'. 
2013-01-13T23:27:23+00:00 app[web.1]: 
2013-01-13T23:27:25+00:00 app[web.1]: [2013-01-13 23:27:25] INFO WEBrick 1.3.1 
2013-01-13T23:27:25+00:00 app[web.1]: [2013-01-13 23:27:25] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] 
2013-01-13T23:27:25+00:00 app[web.1]: [2013-01-13 23:27:25] INFO WEBrick::HTTPServer#start: pid=2 port=56864 
2013-01-13T23:27:28+00:00 heroku[web.1]: State changed from starting to up 
2013-01-13T23:27:29+00:00 app[web.1]: => Booting WEBrick 
2013-01-13T23:27:29+00:00 app[web.1]: => Rails 3.2.8 application starting in production on http://0.0.0.0:56864 
2013-01-13T23:27:29+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-01-13T23:27:29+00:00 app[web.1]: => Call with -d to detach 
2013-01-13T23:27:29+00:00 app[web.1]: 
2013-01-13T23:27:29+00:00 app[web.1]: 
2013-01-13T23:27:29+00:00 app[web.1]: Started GET "/" for 81.83.230.107 at 2013-01-13 23:27:29 +0000 
2013-01-13T23:27:31+00:00 app[web.1]: Connecting to database specified by DATABASE_URL 
2013-01-13T23:27:35+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2013-01-13T23:27:36+00:00 app[web.1]: Rendered static_pages/home.html within layouts/application (246.2ms) 
2013-01-13T23:27:36+00:00 app[web.1]: Completed 500 Internal Server Error in 948ms 
2013-01-13T23:27:36+00:00 app[web.1]: 
2013-01-13T23:27:36+00:00 app[web.1]: 
2013-01-13T23:27:36+00:00 app[web.1]:  5: <%= stylesheet_link_tag "application", :media => "all" %> 
2013-01-13T23:27:36+00:00 app[web.1]: 
2013-01-13T23:27:36+00:00 app[web.1]: ActionView::Template::Error (bootstrap-responsive.css isn't precompiled): 
2013-01-13T23:27:36+00:00 app[web.1]:  4: <title>Leanbrewsite</title> 
2013-01-13T23:27:36+00:00 app[web.1]:  3: <head> 
2013-01-13T23:27:36+00:00 app[web.1]:  7: <%= javascript_include_tag "application" %> 
2013-01-13T23:27:36+00:00 app[web.1]:  9: 
2013-01-13T23:27:36+00:00 app[web.1]:  6: <%= stylesheet_link_tag "bootstrap-responsive", :media => "all" %> 
2013-01-13T23:27:36+00:00 app[web.1]:  8: <%= csrf_meta_tags %> 
2013-01-13T23:27:36+00:00 app[web.1]: app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___2492136347222149984_29076580' 
2013-01-13T23:27:36+00:00 heroku[router]: at=info method=GET path=/ host=safe-plateau-7008.herokuapp.com fwd=81.83.230.107 dyno=web.1 queue=0 wait=8ms connect=23ms service=7130ms status=500 bytes=643 
2013-01-13T23:38:35+00:00 app[web.1]: 
2013-01-13T23:38:35+00:00 app[web.1]: Started GET "/" for 81.83.230.107 at 2013-01-13 23:38:35 +0000 
2013-01-13T23:38:35+00:00 app[web.1]: 
2013-01-13T23:38:35+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2013-01-13T23:38:35+00:00 app[web.1]: Rendered static_pages/home.html within layouts/application (0.3ms) 
2013-01-13T23:38:35+00:00 app[web.1]: Completed 500 Internal Server Error in 2ms 
2013-01-13T23:38:35+00:00 app[web.1]:  8: <%= csrf_meta_tags %> 
2013-01-13T23:38:35+00:00 app[web.1]:  5: <%= stylesheet_link_tag "application", :media => "all" %> 
2013-01-13T23:38:35+00:00 app[web.1]:  3: <head> 
2013-01-13T23:38:35+00:00 app[web.1]: 
2013-01-13T23:38:35+00:00 app[web.1]: ActionView::Template::Error (bootstrap-responsive.css isn't precompiled): 
2013-01-13T23:38:35+00:00 app[web.1]:  4: <title>Leanbrewsite</title> 
2013-01-13T23:38:35+00:00 app[web.1]:  7: <%= javascript_include_tag "application" %> 
2013-01-13T23:38:35+00:00 app[web.1]:  9: 
2013-01-13T23:38:35+00:00 app[web.1]: app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___2492136347222149984_29076580' 
2013-01-13T23:38:35+00:00 app[web.1]: 
2013-01-13T23:38:36+00:00 heroku[router]: at=info method=GET path=/ host=safe-plateau-7008.herokuapp.com fwd=81.83.230.107 dyno=web.1 queue=0 wait=0ms connect=9ms service=25ms status=500 bytes=643 
2013-01-13T23:38:35+00:00 app[web.1]:  6: <%= stylesheet_link_tag "bootstrap-responsive", :media => "all" %> 
2013-01-13T23:38:35+00:00 app[web.1]: 
`` 
+0

你可以給我們一些關於你到目前爲止嘗試過的更多信息嗎? –

+0

我試過到目前爲止: –

+0

我的嘗試: (1)''的Heroku運行耙資產:precompile'' (2)增加了以下我application.css文件: ''/ * ... * =需要引導程序 * =需要引導響應程序 * = require_tree。 * = require_self #啓用資產管道 config.assets.enabled =真 */ @import 「bootstrap.css」; @import「bootstrap-responsive.css」; '' (3)下列內容添加到我的application.js文件: ''// =需要的jQuery // =需要jquery_ujs // =需要引導 // = require_tree。 (4)在config/environments/production.rb中添加以下內容: ''config.assets.precompile + =%w(* .js * .css)'' –

回答

0

Rails的默認情況下,只創建一個的application.js和一個application.css。如果你想要多個目標文件,不知道你是如何做到的!

看起來你已經設置了一些東西來生成一個application.js和一個application.css文件。所以所有的bootstrap都會在你的application.css中,這意味着我不認爲你需要單獨包含bootstrap css。嘗試刪除boostrap css標籤,看看會發生什麼。

如果這不起作用,我會看看公共/資產。 Rails對你的application.js和application.css感到滿意,我懷疑這是因爲它們存在於public/assets中,而bootstrap-responsive.css則不。所以這就是我要開始調試的地方。