将代码推送到Heroku时出错

时间:2015-12-18 21:41:30

标签: ruby-on-rails ruby ruby-on-rails-4 heroku

我在本地运行我的应用程序没有问题。我创建了一个heroku帐户并将我的代码推送到heroku,但是我得到一个一般性错误说"出错了"我在下面粘贴了我的heroku日志...我是Heroku的新手,所以我不确定这里的问题是什么?

的Gemfile:

source 'https://rubygems.org'

ruby "2.1.5"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'bootstrap-sass'
gem "paperclip", "~> 4.3"

group :production do 
    gem 'pg'
    gem 'rails_12factor'    
end

group :development, :test do
    gem 'sqlite3'
end


# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]

heroku日志:

Art West@ARTWESTIV /c/Sites
$ cd ~/desktop

Art West@ARTWESTIV ~/desktop
$ cd yahozzle

Art West@ARTWESTIV ~/desktop/yahozzle (master)
$ heroku logs
Your version of git is 1.9.4.. Which has serious security vulnerabilities.
More information here: https://blog.heroku.com/archives/2014/12/23/update_your_git_clients_on_windows_and_os_x
2015-12-18T21:29:15.599176+00:00 heroku[api]: Enable Logplex by art.westiv@gmail.com
2015-12-18T21:29:15.599176+00:00 heroku[api]: Release v2 created by art.westiv@gmail.com
2015-12-18T21:31:53.237831+00:00 heroku[api]: Set LANG, RAILS_ENV, RACK_ENV, SECRET_KEY_BASE config vars by art.westiv@gmail.com
2015-12-18T21:31:53.237888+00:00 heroku[api]: Release v3 created by art.westiv@gmail.com
2015-12-18T21:31:53.708634+00:00 heroku[api]: Release v4 created by art.westiv@gmail.com
2015-12-18T21:31:53.708634+00:00 heroku[api]: Attach DATABASE resource by art.westiv@gmail.com
2015-12-18T21:31:54.021633+00:00 heroku[api]: Scale to web=1 by art.westiv@gmail.com
2015-12-18T21:31:54.098158+00:00 heroku[api]: Deploy fa5366d by art.westiv@gmail.com
2015-12-18T21:31:54.098248+00:00 heroku[api]: Release v5 created by art.westiv@gmail.com
2015-12-18T21:31:54.415009+00:00 heroku[slug-compiler]: Slug compilation started
2015-12-18T21:31:54.415020+00:00 heroku[slug-compiler]: Slug compilation finished
2015-12-18T21:31:56.834536+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 26611 -e production`
2015-12-18T21:31:59.899640+00:00 app[web.1]: [2015-12-18 21:31:59] INFO  WEBrick 1.3.1
2015-12-18T21:31:59.899656+00:00 app[web.1]: [2015-12-18 21:31:59] INFO  ruby 2.1.5 (2014-11-13) [x86_64-linux]
2015-12-18T21:31:59.899909+00:00 app[web.1]: [2015-12-18 21:31:59] INFO  WEBrick::HTTPServer#start: pid=3 port=26611
2015-12-18T21:32:00.158746+00:00 heroku[web.1]: State changed from starting to up
2015-12-18T21:33:25.989345+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by art.westiv@gmail.com
2015-12-18T21:33:28.792631+00:00 heroku[run.5244]: Awaiting client
2015-12-18T21:33:28.809492+00:00 heroku[run.5244]: Starting process with command `bundle exec rake db:migrate`
2015-12-18T21:33:32.849960+00:00 heroku[run.5244]: Process exited with status 0
2015-12-18T21:33:29.135341+00:00 heroku[run.5244]: State changed from starting to up
2015-12-18T21:34:04.260094+00:00 heroku[router]: at=info method=GET path="/" host=yahozzle.herokuapp.com request_id=8f3e052b-5e55-4822-ac3f-be728a04aacd fwd="206.123.254.90" dyno=web.1 connect=2ms service=62ms status=500 bytes=1754
2015-12-18T21:34:04.183773+00:00 app[web.1]: => Booting WEBrick
2015-12-18T21:34:04.183780+00:00 app[web.1]: => Run `rails server -h` for more startup options
2015-12-18T21:34:04.183778+00:00 app[web.1]: => Rails 4.1.8 application starting in production on http://0.0.0.0:26611
2015-12-18T21:34:04.183781+00:00 app[web.1]: => Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
2015-12-18T21:34:04.183782+00:00 app[web.1]: => Ctrl-C to shutdown server
2015-12-18T21:34:04.183782+00:00 app[web.1]: Started GET "/" for 206.123.254.90 at 2015-12-18 21:34:04 +0000
2015-12-18T21:34:04.225082+00:00 app[web.1]: Processing by ListingsController#index as HTML
2015-12-18T21:34:04.238797+00:00 app[web.1]: Completed 500 Internal Server Error in 14ms
2015-12-18T21:34:04.236903+00:00 app[web.1]:   Rendered listings/index.html.erb within layouts/application (3.6ms)
2015-12-18T21:34:04.240033+00:00 app[web.1]:   * "/app/app/views"
2015-12-18T21:34:04.240029+00:00 app[web.1]:
2015-12-18T21:34:04.240032+00:00 app[web.1]: ActionView::Template::Error (Missing partial Layouts/_header with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in:
2015-12-18T21:34:04.240034+00:00 app[web.1]: ):
2015-12-18T21:34:04.240034+00:00 app[web.1]:      8: </head>
2015-12-18T21:34:04.240035+00:00 app[web.1]:      9:
2015-12-18T21:34:04.240035+00:00 app[web.1]:     10: <body>
2015-12-18T21:34:04.240036+00:00 app[web.1]:     11: <%= render 'Layouts/header' %>
2015-12-18T21:34:04.240036+00:00 app[web.1]:     12: <div class="container">
2015-12-18T21:34:04.240037+00:00 app[web.1]:     13:    <%= yield %>
2015-12-18T21:34:04.240038+00:00 app[web.1]:   app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__2488562101803348584_70335066715400'
2015-12-18T21:34:04.240037+00:00 app[web.1]:     14: <%= render 'Layouts/footer' %>
2015-12-18T21:34:04.240039+00:00 app[web.1]:
2015-12-18T21:34:04.240039+00:00 app[web.1]:
2015-12-18T21:34:04.722117+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=yahozzle.herokuapp.com request_id=f61364ff-7a3e-41c2-865c-51229d244cd1 fwd="206.123.254.90" dyno=web.1 connect=0ms service=3ms status=200 bytes=228
2015-12-18T21:35:06.875160+00:00 app[web.1]: Started GET "/" for 206.123.254.90 at 2015-12-18 21:35:06 +0000
2015-12-18T21:35:06.880338+00:00 app[web.1]:   Rendered listings/index.html.erb within layouts/application (2.0ms)
2015-12-18T21:35:06.883137+00:00 app[web.1]:
2015-12-18T21:35:06.883142+00:00 app[web.1]:   * "/app/app/views"
2015-12-18T21:35:06.883141+00:00 app[web.1]: ActionView::Template::Error (Missing partial Layouts/_header with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in:
2015-12-18T21:35:06.883143+00:00 app[web.1]: ):
2015-12-18T21:35:06.883144+00:00 app[web.1]:      9:
2015-12-18T21:35:06.883143+00:00 app[web.1]:      8: </head>
2015-12-18T21:35:06.883145+00:00 app[web.1]:     11: <%= render 'Layouts/header' %>
2015-12-18T21:35:06.883145+00:00 app[web.1]:     10: <body>
2015-12-18T21:35:06.883146+00:00 app[web.1]:     12: <div class="container">
2015-12-18T21:35:06.883147+00:00 app[web.1]:     14: <%= render 'Layouts/footer' %>
2015-12-18T21:35:06.883147+00:00 app[web.1]:     13:    <%= yield %>
2015-12-18T21:35:06.883149+00:00 app[web.1]:
2015-12-18T21:35:06.883148+00:00 app[web.1]:   app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb__2488562101803348584_70335066715400'
2015-12-18T21:35:06.883150+00:00 app[web.1]:
2015-12-18T21:35:06.877226+00:00 app[web.1]: Processing by ListingsController#index as HTML
2015-12-18T21:35:06.881799+00:00 app[web.1]: Completed 500 Internal Server Error in 4ms
2015-12-18T21:35:06.863666+00:00 heroku[router]: at=info method=GET path="/" host=yahozzle.herokuapp.com request_id=efaaeab9-ce24-4513-9e1d-7ebe584ef31a fwd="206.123.254.90" dyno=web.1 connect=1ms service=16ms status=500 bytes=1754
2015-12-18T21:35:07.337234+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=yahozzle.herokuapp.com request_id=0bb618cf-9bbe-402e-81bb-973771eca373 fwd="206.123.254.90" dyno=web.1 connect=1ms service=4ms status=200 bytes=228

2 个答案:

答案 0 :(得分:1)

您的日志显示错误 - 应用程序尝试呈现无法找到的部分内容。注意文件名的情况 - Heroku的文件系统区分大小写,我猜你有一个目录app/views/layouts,但在你的erb文件中你将其称为Layouts

答案 1 :(得分:1)

它记录的最后一个错误是:

12-18 21:37:01.880 1986-1986/com.example.glenmcmurchy.clamcatcher I/Choreographer: Skipped 163 frames!  The application may be doing too much work on its main thread.
12-18 21:37:16.234 1986-1993/com.example.glenmcmurchy.clamcatcher W/art: Suspending all threads took: 5.598ms
12-18 21:38:24.801 1986-1993/com.example.glenmcmurchy.clamcatcher W/art: Suspending all threads took: 27.638ms
12-18 21:38:25.298 1986-1993/com.example.glenmcmurchy.clamcatcher W/art: Suspending all threads took: 19.039ms
12-18 21:38:37.275 1986-1993/com.example.glenmcmurchy.clamcatcher W/art: Suspending all threads took: 14.913ms

我建议您检查一下是否提交了ActionView::Template::Error (Missing partial Layouts/_header with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :jbuilder]}. Searched in: * "/app/app/views" app/views/layouts/application.html.erb:11:in `_app_views_layouts_application_html_erb 部分,以便将其推送到Heroku,或检查部分是否正确命名而不是拼写错误。您可以ssh到Heroku服务器以检查文件是否存在:

_header

然后,只需heroku run bash 进入views目录,cd列出其内容以查找文件,确保它位于您预期的位置。

另一个问题在这里给出:

ls

您可以在给定的网址上了解相关内容:https://blog.heroku.com/archives/2014/12/23/update_your_git_clients_on_windows_and_os_x