Rails应用程序没有在Heroku上运行

时间:2014-01-09 13:48:52

标签: ruby-on-rails ruby-on-rails-3 heroku gemfile

我正在使用Ruby版本1.9和Rails版本3.2

我已经将它包含在我的gemfile中(按照Micheal Hartl的书中的指示)

group :production do
  gem 'pg', '0.15.1'
  gem 'rails_12factor', '0.0.2'
end

我的repo在我的本地服务器上运行完美,我也可以在Heroku上成功部署它(因为它没有显示任何错误)但是当我尝试在Heroku上打开它时,它说发生了一些错误

Heroku链接:

Link to heroku application which isn't working

我的Github回购:

Github Repository

如何让我的rails应用程序在Heroku上运行?

修改

这是Heroku日志:

2014-01-09T14:29:19.456148+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2014-01-09T14:29:19.456148+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `start'
2014-01-09T14:29:19.456383+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2014-01-09T14:29:19.456383+00:00 app[web.1]:    script/rails:6:in `require'
2014-01-09T14:29:19.456383+00:00 app[web.1]:    script/rails:6:in `<main>'
2014-01-09T14:29:19.456383+00:00 app[web.1]: [2014-01-09 14:29:19] INFO  going to shutdown ...
2014-01-09T14:29:19.456148+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
2014-01-09T14:29:19.456148+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2014-01-09T14:29:19.456383+00:00 app[web.1]: [2014-01-09 14:29:19] INFO  WEBrick::HTTPServer#start done.
2014-01-09T14:29:19.456383+00:00 app[web.1]: Exiting
2014-01-09T14:29:20.728995+00:00 heroku[web.1]: Process exited with status 143
2014-01-09T14:29:21.335721+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 30327`
2014-01-09T14:29:26.583076+00:00 app[web.1]: [2014-01-09 14:29:26] INFO  WEBrick::HTTPServer#start: pid=2 port=30327
2014-01-09T14:29:26.582958+00:00 app[web.1]: [2014-01-09 14:29:26] INFO  ruby 2.0.0 (2013-11-22) [x86_64-linux]
2014-01-09T14:29:26.582958+00:00 app[web.1]: [2014-01-09 14:29:26] INFO  WEBrick 1.3.1
2014-01-09T14:29:26.780187+00:00 heroku[web.1]: State changed from starting to up
2014-01-09T14:29:31.141689+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:30327
2014-01-09T14:29:31.141689+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-01-09T14:29:31.141689+00:00 app[web.1]: Started GET "/" for 115.253.102.219 at 2014-01-09 14:29:31 +0000
2014-01-09T14:29:31.141689+00:00 app[web.1]: => Booting WEBrick
2014-01-09T14:29:31.141689+00:00 app[web.1]: => Call with -d to detach
2014-01-09T14:29:31.417971+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2014-01-09T14:29:31.565602+00:00 app[web.1]: Processing by PagesController#home as HTML
2014-01-09T14:29:31.573778+00:00 app[web.1]:   Rendered pages/home.html.erb within layouts/application (2.0ms)
2014-01-09T14:29:31.577581+00:00 heroku[router]: at=info method=GET path=/ host=khems.herokuapp.com fwd="115.253.102.219" dyno=web.1 connect=2ms service=461ms status=500 bytes=643
2014-01-09T14:29:31.582759+00:00 app[web.1]:     3:  <![endif]-->

2014-01-09T14:29:31.582759+00:00 app[web.1]:     4:  <%= stylesheet_link_tag 'blueprint/screen' , :media => 'screen' %>

2014-01-09T14:29:31.579472+00:00 app[web.1]:   Rendered layouts/_stylesheets.html.erb (2.5ms)
2014-01-09T14:29:31.582759+00:00 app[web.1]:     1: <!--[if lt IE 9]>

2014-01-09T14:29:31.582759+00:00 app[web.1]:     6:  <!--[if lt IE 8]>

2014-01-09T14:29:31.582759+00:00 app[web.1]:     7:  <%= stylesheet_link_tag 'blueprint/ie' %>

2014-01-09T14:29:31.582759+00:00 app[web.1]:   app/views/layouts/_stylesheets.html.erb:4:in `_app_views_layouts__stylesheets_html_erb__3247735197042063147_70327889246660'
2014-01-09T14:29:31.582985+00:00 app[web.1]:   app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__3301566358678381586_70327889035920'
2014-01-09T14:29:31.582985+00:00 app[web.1]: 
2014-01-09T14:29:31.582985+00:00 app[web.1]: 
2014-01-09T14:29:31.582759+00:00 app[web.1]: 
2014-01-09T14:29:31.582759+00:00 app[web.1]:     2:  <script src = "http://html5shiv.googlecode.com/svn/truck/html5.js"></script>

2014-01-09T14:29:31.579878+00:00 app[web.1]: Completed 500 Internal Server Error in 14ms
2014-01-09T14:29:31.582759+00:00 app[web.1]: ActionView::Template::Error (blueprint/screen.css isn't precompiled):
2014-01-09T14:29:31.582759+00:00 app[web.1]:     5:  <%= stylesheet_link_tag 'blueprint/print' , :media=> 'print' %>

2014-01-09T14:29:34.837363+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=khems.herokuapp.com fwd="115.253.102.219" dyno=web.1 connect=1ms service=32ms status=200 bytes=0
2014-01-09T14:29:16.041585+00:00 heroku[api]: Deploy 34c58d2 by piyushkhemka123@gmail.com
2014-01-09T14:29:16.188472+00:00 heroku[api]: Release v13 created by piyushkhemka123@gmail.com
2014-01-09T14:31:30.246363+00:00 app[web.1]: Started GET "/" for 115.253.102.219 at 2014-01-09 14:31:30 +0000
2014-01-09T14:31:30.252668+00:00 app[web.1]: Processing by PagesController#home as HTML
2014-01-09T14:31:30.254018+00:00 app[web.1]:   Rendered pages/home.html.erb within layouts/application (0.4ms)
2014-01-09T14:31:30.261045+00:00 app[web.1]: ActionView::Template::Error (blueprint/screen.css isn't precompiled):
2014-01-09T14:31:30.261045+00:00 app[web.1]:     2:  <script src = "http://html5shiv.googlecode.com/svn/truck/html5.js"></script>

2014-01-09T14:31:30.261045+00:00 app[web.1]:     3:  <![endif]-->

2014-01-09T14:31:30.261045+00:00 app[web.1]:     7:  <%= stylesheet_link_tag 'blueprint/ie' %>

2014-01-09T14:31:30.261045+00:00 app[web.1]:   app/views/layouts/_stylesheets.html.erb:4:in `_app_views_layouts__stylesheets_html_erb__3247735197042063147_70327889246660'
2014-01-09T14:31:30.261220+00:00 app[web.1]:   app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__3301566358678381586_70327889035920'
2014-01-09T14:31:30.262525+00:00 heroku[router]: at=info method=GET path=/ host=khems.herokuapp.com fwd="115.253.102.219" dyno=web.1 connect=5ms service=30ms status=500 bytes=643
2014-01-09T14:31:30.258672+00:00 app[web.1]:   Rendered layouts/_stylesheets.html.erb (0.9ms)
2014-01-09T14:31:30.261045+00:00 app[web.1]: 
2014-01-09T14:31:30.258971+00:00 app[web.1]: Completed 500 Internal Server Error in 6ms
2014-01-09T14:31:30.261045+00:00 app[web.1]:     1: <!--[if lt IE 9]>

2014-01-09T14:31:30.261045+00:00 app[web.1]:     4:  <%= stylesheet_link_tag 'blueprint/screen' , :media => 'screen' %>

2014-01-09T14:31:30.261045+00:00 app[web.1]:     5:  <%= stylesheet_link_tag 'blueprint/print' , :media=> 'print' %>

2014-01-09T14:31:30.261220+00:00 app[web.1]: 
2014-01-09T14:31:30.261220+00:00 app[web.1]: 
2014-01-09T14:31:30.261045+00:00 app[web.1]:     6:  <!--[if lt IE 8]>

2014-01-09T14:38:53.893957+00:00 heroku[router]: at=info method=GET path=/robots.txt host=khems.herokuapp.com fwd="50.17.151.94" dyno=web.1 connect=2ms service=32ms status=200 bytes=204
2014-01-09T14:38:53.935144+00:00 app[web.1]: Started GET "/" for 50.17.151.94 at 2014-01-09 14:38:53 +0000
2014-01-09T14:38:53.947809+00:00 app[web.1]: Processing by PagesController#home as */*
2014-01-09T14:38:53.952314+00:00 app[web.1]:   Rendered pages/home.html.erb within layouts/application (1.0ms)
2014-01-09T14:38:53.954570+00:00 app[web.1]: Completed 500 Internal Server Error in 7ms
2014-01-09T14:38:53.954280+00:00 app[web.1]:   Rendered layouts/_stylesheets.html.erb (1.6ms)
2014-01-09T14:38:53.956529+00:00 app[web.1]: ActionView::Template::Error (blueprint/screen.css isn't precompiled):
2014-01-09T14:38:53.956529+00:00 app[web.1]:     2:  <script src = "http://html5shiv.googlecode.com/svn/truck/html5.js"></script>

2014-01-09T14:38:53.956529+00:00 app[web.1]:     3:  <![endif]-->

2014-01-09T14:38:53.956529+00:00 app[web.1]:     1: <!--[if lt IE 9]>

2014-01-09T14:38:53.956529+00:00 app[web.1]:     4:  <%= stylesheet_link_tag 'blueprint/screen' , :media => 'screen' %>

2014-01-09T14:38:53.956529+00:00 app[web.1]:     5:  <%= stylesheet_link_tag 'blueprint/print' , :media=> 'print' %>

2014-01-09T14:38:53.956529+00:00 app[web.1]: 
2014-01-09T14:38:53.956529+00:00 app[web.1]:     6:  <!--[if lt IE 8]>

2014-01-09T14:38:53.956529+00:00 app[web.1]:     7:  <%= stylesheet_link_tag 'blueprint/ie' %>

2014-01-09T14:38:53.956529+00:00 app[web.1]:   app/views/layouts/_stylesheets.html.erb:4:in `_app_views_layouts__stylesheets_html_erb__3247735197042063147_70327889246660'
2014-01-09T14:38:53.956710+00:00 app[web.1]:   app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__3301566358678381586_70327889035920'
2014-01-09T14:38:53.956710+00:00 app[web.1]: 
2014-01-09T14:38:53.956710+00:00 app[web.1]: 
2014-01-09T14:38:53.963277+00:00 heroku[router]: at=info method=GET path=/ host=khems.herokuapp.com fwd="50.17.151.94" dyno=web.1 connect=7ms service=36ms status=500 bytes=643
2014-01-09T14:39:54.023115+00:00 app[web.1]: Started GET "/" for 115.253.102.219 at 2014-01-09 14:39:54 +0000
2014-01-09T14:39:54.029462+00:00 app[web.1]: Processing by PagesController#home as HTML
2014-01-09T14:39:54.030376+00:00 app[web.1]:   Rendered pages/home.html.erb within layouts/application (0.3ms)
2014-01-09T14:39:54.031387+00:00 app[web.1]:   Rendered layouts/_stylesheets.html.erb (0.6ms)
2014-01-09T14:39:54.031484+00:00 app[web.1]: Completed 500 Internal Server Error in 2ms
2014-01-09T14:39:54.033858+00:00 app[web.1]: 
2014-01-09T14:39:54.033858+00:00 app[web.1]: ActionView::Template::Error (blueprint/screen.css isn't precompiled):
2014-01-09T14:39:54.033858+00:00 app[web.1]:     1: <!--[if lt IE 9]>

2014-01-09T14:39:54.033858+00:00 app[web.1]:     2:  <script src = "http://html5shiv.googlecode.com/svn/truck/html5.js"></script>

2014-01-09T14:39:54.033858+00:00 app[web.1]:     3:  <![endif]-->

2014-01-09T14:39:54.033858+00:00 app[web.1]:     4:  <%= stylesheet_link_tag 'blueprint/screen' , :media => 'screen' %>

2014-01-09T14:39:54.033858+00:00 app[web.1]:     5:  <%= stylesheet_link_tag 'blueprint/print' , :media=> 'print' %>

2014-01-09T14:39:54.034039+00:00 app[web.1]:   app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb__3301566358678381586_70327889035920'
2014-01-09T14:39:54.033858+00:00 app[web.1]:     6:  <!--[if lt IE 8]>

2014-01-09T14:39:54.033858+00:00 app[web.1]:     7:  <%= stylesheet_link_tag 'blueprint/ie' %>

2014-01-09T14:39:54.033858+00:00 app[web.1]:   app/views/layouts/_stylesheets.html.erb:4:in `_app_views_layouts__stylesheets_html_erb__3247735197042063147_70327889246660'
2014-01-09T14:39:54.034039+00:00 app[web.1]: 
2014-01-09T14:39:54.034039+00:00 app[web.1]: 
2014-01-09T14:39:54.033750+00:00 heroku[router]: at=info method=GET path=/ host=khems.herokuapp.com fwd="115.253.102.219" dyno=web.1 connect=1ms service=21ms status=500 bytes=643

这是资产编译日志

  E:/RailsInstaller/Ruby1.9.3/bin/ruby.exe E:/RailsInstaller/Ruby1.9.3/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets

Compiled jquery.js  (16ms)  (pid 13464)
Compiled jquery_ujs.js  (1ms)  (pid 13464)
Compiled pages.js  (198ms)  (pid 13464)
Compiled users.js  (205ms)  (pid 13464)
Compiled application.js  (494ms)  (pid 13464)
Compiled custom.css  (0ms)  (pid 13464)
Compiled pages.css  (12ms)  (pid 13464)
Compiled users.css  (4ms)  (pid 13464)
Compiled application.css  (62ms)  (pid 13464)
Compiled jquery.js  (21ms)  (pid 11524)
Compiled jquery_ujs.js  (0ms)  (pid 11524)
Compiled pages.js  (335ms)  (pid 11524)
Compiled users.js  (312ms)  (pid 11524)
Compiled application.js  (773ms)  (pid 11524)
Compiled custom.css  (0ms)  (pid 11524)
Compiled pages.css  (10ms)  (pid 11524)
Compiled users.css  (16ms)  (pid 11524)
Compiled application.css  (69ms)  (pid 11524)

1 个答案:

答案 0 :(得分:2)

首先将您的blueprint目录移至assets/stylesheets目录。

添加到environment / production.rb

config.assets.precompile += %w( blueprint/screen.css blueprint/print.css blueprint/ie.css custom.css)

如果您愿意,可以预先编译您的资产:

bundle exec rake assets:precompile RAILS_ENV=production