2015-12-18 89 views
0

我在本地運行我的應用程序時沒有問題。我創建了一個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 [email protected] /c/Sites 
$ cd ~/desktop 

Art [email protected] ~/desktop 
$ cd yahozzle 

Art [email protected] ~/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 [email protected] 
2015-12-18T21:29:15.599176+00:00 heroku[api]: Release v2 created by [email protected] 
2015-12-18T21:31:53.237831+00:00 heroku[api]: Set LANG, RAILS_ENV, RACK_ENV, SECRET_KEY_BASE config vars by [email protected] 
2015-12-18T21:31:53.237888+00:00 heroku[api]: Release v3 created by [email protected] 
2015-12-18T21:31:53.708634+00:00 heroku[api]: Release v4 created by [email protected] 
2015-12-18T21:31:53.708634+00:00 heroku[api]: Attach DATABASE resource by [email protected] 
2015-12-18T21:31:54.021633+00:00 heroku[api]: Scale to web=1 by [email protected] 
2015-12-18T21:31:54.098158+00:00 heroku[api]: Deploy fa5366d by [email protected] 
2015-12-18T21:31:54.098248+00:00 heroku[api]: Release v5 created by [email protected] 
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 [email protected] 
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 
+0

猜猜你想從渲染'layouts',而不是'Layouts'。使用小寫的L.似乎你正在使用Windows機器。 – iltempo

回答

1

你的日誌顯示錯誤 - 應用程序試圖呈現諧音無法找到。注意文件名的情況 - Heroku的文件系統是區分大小寫的,我的猜測是你有一個目錄app/views/layouts,但在你的erb文件中你把它稱爲Layouts

+0

那麼我在哪裏改變資本空間? – westman2222

+0

區分大小寫需要您在同一個案例中命名文件,即'your_file.rb'與'Your_file.rb'不同' – DiegoSalazar

+0

'以'app/views/layouts/application.html.erb'開頭 - 日誌會告訴你究竟是什麼發現錯誤的地方。 – eugen

1

它記錄的最後一個錯誤是:

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 

我建議檢查,看看你犯了_header部分,這樣它推到Heroku的,或檢查,看看是否部分文件名是否正確,而不是一個錯字。您可以通過SSH進入Heroku的服務器來檢查文件是否存在:

heroku run bash 

然後,只需cd到的意見,目錄和ls列出其內容查找的文件時,請確保它在你所期望的地方。

另一個問題是,這裏給出:

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 

你可以閱讀有關給定的URL:https://blog.heroku.com/archives/2014/12/23/update_your_git_clients_on_windows_and_os_x