rails heroku部署错误:预编译资产

时间:2013-01-14 00:00:00

标签: ruby-on-rails deployment heroku

我的rails应用程序在localhost中运行正常,但无法在heroku上部署。我已经搜索/尝试了与资产预编译相关的原因(例如:heroku run rake assets:precompile),但显然这些方法似乎没有给出任何积极的结果。

这是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 didier@leanbrew.com
2013-01-13T23:27:04+00:00 heroku[api]: Deploy 197fc85 by didier@leanbrew.com
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]:
``

1 个答案:

答案 0 :(得分: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则没有。这就是我开始调试的地方。