2013-06-22 5 views
0

посмотреть https://help.heroku.com/tickets/89264проблема с precompilation. пытаясь развернуть приложение рельсы с Heroku

в основном, я обновил свой config/environments/production.rb файл и последовал
этот совет https://devcenter.heroku.com/articles/rails-asset-pipeline#compiling-assets-locally, но она по-прежнему не работает.

я просто изменил
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) # config.assets.precompile += %w(search.js)
в
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) config.assets.precompile += %w(home.css)

, а затем сделал следующее:

~/collegeanswerz >> RAILS_ENV=production bundle exec rake assets:precompile 
/Users/adamzerner/.rvm/rubies/ruby-1.9.3-p327/bin/ruby /Users/adamzerner/.rvm/gems/ruby-1.9.3- [email protected]/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets 
~/collegeanswerz >> git add public/assets 
~/collegeanswerz >> git commit -m "vendor compiled assets 2" 
[master 23fa523] vendor compiled assets 2 
9 files changed, 4 insertions(+) 
create mode 100644 public/assets/home-73d942132cfdcc305dabf385494f8201.css 
create mode 100644 public/assets/home-73d942132cfdcc305dabf385494f8201.css.gz 
create mode 100644 public/assets/home.css 
create mode 100644 public/assets/home.css.gz 
~/collegeanswerz >> git push heroku master 
Counting objects: 20, done. 
Delta compression using up to 2 threads. 
Compressing objects: 100% (12/12), done. 
Writing objects: 100% (12/12), 2.30 KiB, done. 
Total 12 (delta 9), reused 0 (delta 0) 

-----> Removing .DS_Store files 
-----> Ruby/Rails app detected 
-----> Using Ruby version: ruby-1.9.3 
-----> Installing dependencies using Bundler version 1.3.2 
    Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment 
    Using rake (10.0.4) 
    Using i18n (0.6.1) 
    Using multi_json (1.7.3) 
    Using activesupport (3.2.13) 
    Using builder (3.0.4) 
    Using activemodel (3.2.13) 
    Using erubis (2.7.0) 
    Using journey (1.0.4) 
    Using rack (1.4.5) 
    Using rack-cache (1.2) 
    Using rack-test (0.6.2) 
    Using hike (1.2.2) 
    Using tilt (1.4.1) 
    Using sprockets (2.2.2) 
    Using actionpack (3.2.13) 
    Using mime-types (1.23) 
    Using polyglot (0.3.3) 
    Using treetop (1.4.12) 
    Using mail (2.5.3) 
    Using actionmailer (3.2.13) 
    Using arel (3.0.2) 
    Using tzinfo (0.3.37) 
    Using activerecord (3.2.13) 
    Using activeresource (3.2.13) 
    Using coffee-script-source (1.6.2) 
    Using execjs (1.4.0) 
    Using coffee-script (2.2.0) 
    Using rack-ssl (1.3.3) 
    Using json (1.7.7) 
    Using rdoc (3.12.2) 
    Using thor (0.18.1) 
    Using railties (3.2.13) 
    Using coffee-rails (3.2.2) 
    Using dynamic_form (1.1.4) 
    Using jquery-rails (2.2.1) 
    Using pg (0.12.2) 
    Using bundler (1.3.2) 
    Using rails (3.2.13) 
    Using sass (3.2.9) 
    Using sass-rails (3.2.6) 
    Using uglifier (2.1.0) 
    Your bundle is complete! It was installed into ./vendor/bundle 
    Cleaning up the bundler cache. 
-----> Writing config/database.yml to read from DATABASE_URL 
-----> Preparing app for Rails asset pipeline 
    Detected manifest.yml, assuming assets were compiled locally 
-----> WARNINGS: 
    you have not declared a Ruby version in your Gemfile. 
    To set your Ruby version add this line to your Gemfile:" 
    ruby '1.9.3'" 
    # See https://devcenter.heroku.com/articles/ruby-versions for more information." 
-----> Rails plugin injection 
    Injecting rails_log_stdout 
    Injecting rails3_serve_static_assets 
-----> Discovering process types 
    Procfile declares types  -> (none) 
    Default types for Ruby/Rails -> console, rake, web, worker 

-----> Compiled slug size: 20.1MB 
-----> Launching... done, v9 
    http://fast-reaches-9399.herokuapp.com deployed to Heroku 

To [email protected]:fast-reaches-9399.git 
    28772c1..23fa523 master -> master 
~/collegeanswerz >> heroku open 
Opening fast-reaches-9399... done 

, но я до сих пор получил ту же ошибку 500.

Может ли кто-нибудь помочь мне с этим? Я очень хочу развернуть, и я не могу понять, что я делаю неправильно. Я читал https://devcenter.heroku.com/articles/rails-asset-pipeline#compiling-assets-locally и http://guides.rubyonrails.org/asset_pipeline.html, но я до сих пор не знаю, что случилось. любая помощь будет оценена по достоинству. Благодарю.

EDIT: Я только добавил home.css к config/environments/production.rb. Однако у меня есть другие файлы css и javascript. Нужно ли добавлять их вместе с home.css? Я смущен тем, что мне нужно добавить к этому файлу, а что нет.

Heroku Журналы:

~/collegeanswerz >> heroku logs 
2013-06-21T18:09:38.400164+00:00 app[web.1]: => Call with -d to detach 
2013-06-21T18:09:38.400164+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-06-21T18:09:38.400164+00:00 app[web.1]: Connecting to database specified by DATABASE_URL 
2013-06-21T18:09:41.816038+00:00 app[web.1]: [2013-06-21 18:09:41] INFO WEBrick::HTTPServer#start: pid=2 port=37598 
2013-06-21T18:09:41.806086+00:00 app[web.1]: [2013-06-21 18:09:41] INFO WEBrick 1.3.1 
2013-06-21T18:09:41.806250+00:00 app[web.1]: [2013-06-21 18:09:41] INFO ruby 1.9.3 (2013-05-15) [x86_64-linux] 
2013-06-21T18:09:41.846306+00:00 heroku[web.1]: State changed from starting to up 
2013-06-21T18:09:42.983092+00:00 app[web.1]: Started GET "/" for 150.212.44.53 at 2013-06-21 18:09:42 +0000 
2013-06-21T18:09:43.796440+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2013-06-21T18:09:43.918982+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (26.0ms) 
2013-06-21T18:09:43.926737+00:00 app[web.1]: app/views/static_pages/home.html.erb:1:in `_app_views_static_pages_home_html_erb___725405358529282062_26831120' 
2013-06-21T18:09:43.919413+00:00 app[web.1]: Completed 500 Internal Server Error in 121ms 
2013-06-21T18:09:43.926737+00:00 app[web.1]: 
2013-06-21T18:09:43.926737+00:00 app[web.1]: ActionView::Template::Error (home.css isn't precompiled): 
2013-06-21T18:09:43.926737+00:00 app[web.1]:  1: <%= stylesheet_link_tag "home", :media => "all" %> 
2013-06-21T18:09:43.926737+00:00 app[web.1]:  2: <%= javascript_include_tag :application %> 
2013-06-21T18:09:43.926737+00:00 app[web.1]:  3: <% provide(:title, 'CollegeANSWERZ') %> 
2013-06-21T18:09:43.926737+00:00 app[web.1]:  4: 
2013-06-21T18:09:43.926737+00:00 app[web.1]: 
2013-06-21T18:09:43.926737+00:00 app[web.1]: 
2013-06-21T18:09:43.930798+00:00 heroku[router]: at=info method=GET path=/ host=fast-reaches-9399.herokuapp.com fwd="150.212.44.53" dyno=web.1 connect=9ms service=997ms status=500 bytes=643 
2013-06-21T18:10:43.120112+00:00 app[web.1]: Completed 500 Internal Server Error in 2ms 
2013-06-21T18:10:43.119811+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (0.8ms) 
2013-06-21T18:10:43.109481+00:00 app[web.1]: Started GET "/" for 130.49.162.173 at 2013-06-21 18:10:43 +0000 
2013-06-21T18:10:43.115024+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2013-06-21T18:10:43.163822+00:00 heroku[router]: at=info method=GET path=/ host=fast-reaches-9399.herokuapp.com fwd="130.49.162.173" dyno=web.1 connect=1ms service=65ms status=500 bytes=643 
2013-06-21T18:10:43.159816+00:00 app[web.1]:  4: 
2013-06-21T18:10:43.159816+00:00 app[web.1]: app/views/static_pages/home.html.erb:1:in `_app_views_static_pages_home_html_erb___725405358529282062_26831120' 
2013-06-21T18:10:43.159816+00:00 app[web.1]:  3: <% provide(:title, 'CollegeANSWERZ') %> 
2013-06-21T18:10:43.159816+00:00 app[web.1]: ActionView::Template::Error (home.css isn't precompiled): 
2013-06-21T18:10:43.159816+00:00 app[web.1]: 
2013-06-21T18:10:43.159816+00:00 app[web.1]: 
2013-06-21T18:10:43.159816+00:00 app[web.1]:  1: <%= stylesheet_link_tag "home", :media => "all" %> 
2013-06-21T18:10:43.159816+00:00 app[web.1]: 
2013-06-21T18:10:43.159816+00:00 app[web.1]:  2: <%= javascript_include_tag :application %> 
2013-06-21T18:10:43.284647+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=fast-reaches-9399.herokuapp.com fwd="130.49.162.173" dyno=web.1 connect=2ms service=14ms status=200 bytes=0 
2013-06-21T18:31:38.978118+00:00 app[web.1]: Started GET "/" for 150.212.67.168 at 2013-06-21 18:31:38 +0000 
2013-06-21T18:31:38.988162+00:00 app[web.1]: ActionView::Template::Error (home.css isn't precompiled): 
2013-06-21T18:31:38.981955+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2013-06-21T18:31:38.983438+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (0.7ms) 
2013-06-21T18:31:38.984407+00:00 app[web.1]: Completed 500 Internal Server Error in 2ms 
2013-06-21T18:31:38.988162+00:00 app[web.1]: 
2013-06-21T18:31:38.988162+00:00 app[web.1]:  1: <%= stylesheet_link_tag "home", :media => "all" %> 
2013-06-21T18:31:38.988162+00:00 app[web.1]:  2: <%= javascript_include_tag :application %> 
2013-06-21T18:31:38.976788+00:00 heroku[router]: at=info method=GET path=/ host=fast-reaches-9399.herokuapp.com fwd="150.212.67.168" dyno=web.1 connect=2ms service=23ms status=500 bytes=643 
2013-06-21T18:31:38.988162+00:00 app[web.1]:  3: <% provide(:title, 'CollegeANSWERZ') %> 
2013-06-21T18:31:38.988162+00:00 app[web.1]:  4: 
2013-06-21T18:31:38.988162+00:00 app[web.1]: app/views/static_pages/home.html.erb:1:in `_app_views_static_pages_home_html_erb___725405358529282062_26831120' 
2013-06-21T18:31:38.988162+00:00 app[web.1]: 
2013-06-21T18:31:38.988162+00:00 app[web.1]: 
2013-06-21T18:31:39.272322+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=fast-reaches-9399.herokuapp.com fwd="150.212.67.168" dyno=web.1 connect=1ms service=14ms status=200 bytes=0 
2013-06-21T19:34:46.968884+00:00 heroku[web.1]: Idling 
2013-06-21T19:34:51.384909+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2013-06-21T19:34:52.554631+00:00 app[web.1]: [2013-06-21 19:34:52] ERROR SignalException: SIGTERM 
2013-06-21T19:34:52.554631+00:00 app[web.1]: /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/server.rb:98:in `select' 
2013-06-21T19:35:01.380745+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2013-06-21T19:35:01.381015+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2013-06-21T19:35:04.641711+00:00 heroku[web.1]: State changed from up to down 
2013-06-21T19:35:04.615493+00:00 heroku[web.1]: Process exited with status 137 
2013-06-22T01:19:15.580026+00:00 heroku[api]: Deploy 23fa523 by [email protected] 
2013-06-22T01:19:15.610236+00:00 heroku[api] 
: Release v9 created by [email protected] 
2013-06-22T01:19:15.645481+00:00 heroku[api]: Deploy 23fa523 by [email protected] 
2013-06-22T01:19:15.812011+00:00 heroku[web.1]: State changed from down to starting 
2013-06-22T01:19:19.358919+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 16312` 
2013-06-22T01:19:24.227544+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-06-22T01:19:24.227544+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-06-22T01:19:26.887652+00:00 app[web.1]: => Ctrl-C to shutdown server 
2013-06-22T01:19:26.887652+00:00 app[web.1]: => Booting WEBrick 
2013-06-22T01:19:26.887652+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:16312 
2013-06-22T01:19:26.887652+00:00 app[web.1]: => Call with -d to detach 
2013-06-22T01:19:26.887652+00:00 app[web.1]: Connecting to database specified by DATABASE_URL 
2013-06-22T01:19:27.090788+00:00 app[web.1]: [2013-06-22 01:19:27] INFO WEBrick 1.3.1 
2013-06-22T01:19:27.091334+00:00 app[web.1]: [2013-06-22 01:19:27] INFO WEBrick::HTTPServer#start: pid=2 port=16312 
2013-06-22T01:19:27.090788+00:00 app[web.1]: [2013-06-22 01:19:27] INFO ruby 1.9.3 (2013-05-15) [x86_64-linux] 
2013-06-22T01:19:27.339684+00:00 heroku[web.1]: State changed from starting to up 
2013-06-22T01:19:30.066268+00:00 app[web.1]: Started GET "/" for 24.131.255.163 at 2013-06-22 01:19:30 +0000 
2013-06-22T01:19:30.468648+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2013-06-22T01:19:30.537004+00:00 heroku[router]: at=info method=GET path=/ host=fast-reaches-9399.herokuapp.com fwd="24.131.255.163" dyno=web.1 connect=1ms service=488ms status=500 bytes=643 
2013-06-22T01:19:30.525930+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (8.3ms) 
2013-06-22T01:19:30.537856+00:00 app[web.1]: 
2013-06-22T01:19:30.537856+00:00 app[web.1]: ActionView::Template::Error (layout.css isn't precompiled): 
2013-06-22T01:19:30.537856+00:00 app[web.1]:  2: <html> 
2013-06-22T01:19:30.537856+00:00 app[web.1]:  7: <%= csrf_meta_tags %> 
2013-06-22T01:19:30.532648+00:00 app[web.1]: Completed 500 Internal Server Error in 64ms 
2013-06-22T01:19:30.537856+00:00 app[web.1]: app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___1612393333745609223_32479780' 
2013-06-22T01:19:30.538131+00:00 app[web.1]: 
2013-06-22T01:19:30.537856+00:00 app[web.1]:  8: </head> 
2013-06-22T01:19:30.538131+00:00 app[web.1]: 
2013-06-22T01:19:30.537856+00:00 app[web.1]:  3: <head> 
2013-06-22T01:19:30.537856+00:00 app[web.1]:  4: <title><%= yield(:title) %></title> 
2013-06-22T01:19:30.537856+00:00 app[web.1]:  5: <%= stylesheet_link_tag "layout", :media => "all" %> 
2013-06-22T01:19:30.537856+00:00 app[web.1]:  6: <%= javascript_include_tag "application" %> 
2013-06-22T01:19:31.142918+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=fast-reaches-9399.herokuapp.com fwd="24.131.255.163" dyno=web.1 connect=1ms service=48ms status=200 bytes=0 
2013-06-22T02:25:29.121546+00:00 heroku[web.1]: Idling 
2013-06-22T02:25:34.186899+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2013-06-22T02:25:35.206762+00:00 app[web.1]: /app/vendor/ruby-1.9.3/lib/ruby/1.9.1/webrick/server.rb:98:in `select' 
2013-06-22T02:25:35.206762+00:00 app[web.1]: [2013-06-22 02:25:35] ERROR SignalException: SIGTERM 
2013-06-22T02:25:43.540073+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 10 seconds of SIGTERM 
2013-06-22T02:25:43.540320+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL 
2013-06-22T02:25:46.353635+00:00 heroku[web.1]: State changed from up to down 
2013-06-22T02:25:46.337936+00:00 heroku[web.1]: Process exited with status 137 
~/collegeanswerz >> 
+0

Можете ли вы разместить журналы heroku, чтобы мы могли видеть, почему вы получаете сообщение об ошибке? –

+0

Также мы не видим вашу ссылку на билет ... –

+0

О, прошу прощения за ссылку на билет. в основном, сначала я не делал предварительной компиляции, а затем я сделал то, что сказал, что сделал в своем вопросе, и он все еще не работает. –

ответ

0

Теперь, когда я вижу ваши журналы я некоторые глядя вокруг, и вы не единственный человек, чтобы испытать это. Попробуйте удалить локально скомпилированные активы с помощью: git rm -r public/assets, затем нажмите на герою. Оставьте изменения, внесенные в ваш production.rb.

+0

попробовал и получил 500 ошибок:/ –

+0

странно вы пробовали использовать другой ресурс, например application.css вместо дома? Это не имеет значения, но стоит попробовать. Я буду оглядываться, я покинул Heroku около года назад для AWS Elastic Beanstalk, поэтому я не очень хорошо знаком с Heroku. –

+0

Я думаю, я исправил его. Я думаю, что у вас есть все ваши файлы css и js в файле production.rb, кроме application.css и application.js. как только я это сделал, это сработало. см. мой ответ. –

0

Я видел ваше сообщение в StackOverflow, и это круто! Мне нравится видеть, как люди помогают друг другу в сообществе. Вы помните, что вызвало вашу проблему в прошлый раз? Это было:

ActionView :: Template :: Error (home.css не прекомпилировано): И вам нужно было добавить home.css в config/environment/production.rb. Вам нужно сообщить production.rb, что вам нужно home.css. Вы должны сказать, что вам нужны другие файлы css, чем application.css.

Теперь, какую ошибку вы видите в своем журнале после развертывания?

ActionView :: Template :: Error (layout.css не прекомпилировано): Выяснено? Теперь вам нужно добавить layout.css. Вы можете просто добавить вот так:

% w (home.css layout.css) Опять же, вам нужно добавить каждый css, который вам нужен, кроме application.css, в config/environment/production.rb. Если у вас есть js-файлы, которые вам нужно добавить, отличные от application.js, вам также нужно добавить в config/environment/production.rb. Я вижу, что есть много файлов css, которые вам нужно добавить в приложение (например, college_pages, эссе, about_college и т. Д. Для css, about_college для js). Чтение вашего журнала - это первый шаг для отладки, программирования. Журнал всегда говорит вам что-то (если нет журналов, я бы не смог указать на вашу проблему!). Мне жаль, что я не сказал вам, как смотреть ваши журналы (похоже, вы не знали об этом).

Здесь использование читать ваш журнал:

Использование: Heroku журналы

выход дисплея недавний журнал

-n, --num NUM # количество строк для отображения -p , --ps PS # отображать только журналы из данного процесса -s, --source SOURCE # отображать только журналы из данного источника -t, --tail # непрерывно поток бревна

экзамен PLE:

$ Heroku журналы 2012-01-01T12: 00: 00 + 00: 00 Heroku [API]: Config добавить пример, [email protected] 2012-01-01T12: 00: 01 + 00: 00 heroku [api]: выпуск v1 создан по электронной почте@example.com Вы можете сделать что-то вроде журналов heroku -n 100, чтобы просмотреть последние 100 строк журналов.

Надеется, что это помогает, Keiko


Большого спасибо за вашу помощь! Я знаю, что вы не согласны с моей ответственностью, и я это ценю.

Я добавил все мои другие файлы css и js в production.rb, и я развернулся успешно! Причина, по которой я был в замешательстве, заключалась в том, что я не понимал, что должен был включить их в production.rb. Я почему-то подумал, что application.css и application.js каким-то образом сделали это, поэтому мне не пришлось, и я подумал, что home.css по какой-то причине является исключением.