Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails应用程序未在Heroku上运行_Ruby On Rails_Ruby On Rails 3_Heroku_Gemfile - Fatal编程技术网

Ruby on rails Rails应用程序未在Heroku上运行

Ruby on rails Rails应用程序未在Heroku上运行,ruby-on-rails,ruby-on-rails-3,heroku,gemfile,Ruby On Rails,Ruby On Rails 3,Heroku,Gemfile,我使用的是Ruby 1.9版和Rails 3.2版 我已将其包含在我的GEM文件中(按照Micheal Hartl在其书中的指示) 我的repo在本地服务器上运行得很好,我也可以在Heroku上成功部署它(在中,它没有显示任何错误),但当我尝试在Heroku上打开它时,它说发生了一些错误 Heroku链接: 我的Github回购协议: 如何让rails应用程序在Heroku上运行 编辑: 这是Heroku日志: 2014-01-09T14:29:19.456148+00:00 app[web

我使用的是Ruby 1.9版和Rails 3.2版

我已将其包含在我的GEM文件中(按照Micheal Hartl在其书中的指示)

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

Heroku链接:

我的Github回购协议:

如何让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

首先将您的
blueprint
目录移动到
assets/stylesheets
目录中

添加到环境/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

您是否迁移了db和预编译资产?我看到了您的GEM文件,请在本地控制台中发布
bundle install--without=test,development
,首先执行
git add.
,然后执行
bundle install
?做如下事情。1.
bundle安装--without=test,development
,并确保它在没有错误的情况下通过,2。问题
捆绑安装
,3。发布git add.;4.发出git add-f Gemfile.lock5。提交更改6。发布推送至heroku。我看不到您已激活Rake 10.1.1的
,但您的Gemfile仍需要10.1.0
错误。。。你能显示heroku推送日志吗?预编译错误提到了
screen.css
,但我在编译日志中的编译资产列表中没有看到这一点。CSS文件可能没有包含在预编译中,如果您正在开发中编译资产,您可能不会在本地注意到这一点。因此,它会在生产环境中中断,但不会在其他地方中断。检查您的
config/environments/
文件夹,并比较各种
config.assets
开发选项和生产选项。啊……终于成功了。非常感谢:)两个问题供将来参考:1>我是否应该将blueprint/bootstrap或任何其他css框架放入assets/stylesheets目录,而不是教程建议的公用文件夹?2> 在每次将资产推送到heroku之前,我是否需要预编译它们?是的,将所有css/Javascript放入资产目录是一种很好的做法。看看如何更好地使用资产管道。在production.rb中,config.assets.compile设置为false,因此您需要在推送heroku之前进行预编译。如果我将该值设置为true,它是否可以在不进行预编译的情况下工作,或者在其他地方导致问题?
config.assets.precompile += %w( blueprint/screen.css blueprint/print.css blueprint/ie.css custom.css)
bundle exec rake assets:precompile RAILS_ENV=production