2016-10-10 9 views
0

/app/assets/javascripts/app/assets/stylesheetsに必要なファイルを追加し、index.html.erbファイルを次のように変更しました。この:html、js、cssが追加され、Ruby on Railsアプリはコンパイルされません

index.html.erb

<head> 
     <meta charset="utf-8"> 
     <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
     <meta name="viewport" content="width=device-width, initial-scale=1"> 
     <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> 

     <link rel="stylesheet" type="text/css" href="/app/assets/stylesheets/styles.css"> 
     <link rel="stylesheet" type="text/css" href="/app/assets/stylesheets/colorbox.css"> 
     <link rel="stylesheet" type="text/css" href="/app/assets/stylesheets/style.css"> 
     <meta name="description" content=""> 
     <meta name="author" content=""> 
     <title>Customer Analysis | Welcome</title> 
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> 
     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous"> 
    </head> 
    <body> 



    <div id="main-container"> 
     <div id="content"> 
      <div id="menu"> 
       <a href="http://customers.priceanalytics.net/">Home</a> 
      </div> 
      <div class="container"> 
       <h2>Customer Analysis</h2> 
       <div class="row"> 
        <ul class="nav nav-tabs" id="tab"> 
         <li class="active" role="presentation"> 
          <a href="#dashboard">Retention</a> 
         </li> 
         <li class="" role="presentation"> 
          <a href="#experiments">Cohort</a> 
         </li> 
         <li class="" role="presentation"> 
          <a href="#clv">Customer Lifetime Value</a> 
         </li> 
         <li class="" role="presentation"> 
          <a href="#mapped">Map</a> 
         </li> 
         <li class="" role="filter"> 
          <a href="#filter">Customer Audiences</a> 
         </li> 
        </ul> 
        <div class="tab-content"> 
         <div class="tab-pane fade active in" id="dashboard"> 
          <div class="row" id="retention"></div> 
         </div> 
         <div class="tab-pane fade" id="experiments"> 
          <center> 
           <h2>Sales</h2> 
          </center> 
          <div class="row" id="cohorttable"></div> 
         </div> 
         <div id="filter" class="tab-pane fade"> 
          <center><h2>Customer Audiences</h2></center> 
          <div id="crossfilter" class="row"> 
          <div id="leftpane"> 
           <div id="propertylist"></div> 
           <button class="btn btn-primary">Save data</button> 
          </div> 
          <div id="rightpane"> 
           <div id="charts"></div> 
           <aside id="totals"><span id="active">-</span> of <span id="total">-</span> customers fit the above criteria.</aside> 
           <div id="lists"> 
           <table class="customer-list"> 
            <tr class="customer"> 
            <td class="shippingname">Shipping name</td> 
            <td class="e-mail">e-mail</td> 
            <td class="time">First date</td> 
            <td class="time">Last date</td> 
            <td class="currency">Total sales</td> 
            <td class="currency">NPV</td> 
            <td class="currency">AOV</td> 
            <td class="smallnumber">Orders</td> 
            <td class="smallnumber">Items</td> 
            <td class="time">Time btw</td> 
            <td class="zipcode">ZIP</td> 
            <td class="gender">Gender</td> 
            </tr> 
           </table> 
           <table id="customer-list" class="customer-list list"></table> 
           </div> 
          </div> 
          </div> 
         </div> 
         <div class="tab-pane fade" id="clv"> 
          <center> 
           <h2>Customer Lifetime Value</h2> 
          </center> 
          <div class="row" id="clv"> 
              <div class="col-sm-1"></div> 
      <div class="col-md-2"><p>Repeat Customer Rate:</p><p><span cmd="repeat_cust_rate"></span>%</p></div> 
      <div class="col-md-2"><p>Average Order Value:</p><p>$<span cmd="avg_order_val"></span></p></div> 
      <div class="col-md-2"><p>Time Between Purchases:</p><p><span cmd="time_btw_purchase"></span></p></div> 
      <div class="col-md-2"><p>Purchase Frequency:</p><p><span cmd="purchase_frequency"></span></p></div> 
      <div class="col-md-2"><p>Customer Value:</p><p>$<span cmd="cust_value"></span></p></div> 
      <div class="col-sm-1"></div> 

          <script> 
       var lifetimeValues = $('#clv').find('.col-md-2 span'); 

       lifetimeValues.each(function(){ 
        $(this).html(clv_data[0][ $(this).attr('cmd') ].toFixed(2)); 
       }); 

          </script> 
          </div> 
         </div> 
         <div class="tab-pane fade" id="mapped"> 
          <div class="row" id="map"></div> 
         </div> 
        </div> 
       </div> 
      </div> 
      <div id="popup"> 
       <table></table> 
      </div> 
      <div id="selectioninfo"> 
       <table></table><button id="savedata" class="btn btn-primary">Save data</button> 
      </div>   


       <script src= 
       "https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"> 
       </script> 
       <script src= 
       "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"> 
       </script> 
       <script type="text/javascript"> 
       $(function() { 
        $('#tab a').click(function(e) { 
         e.preventDefault(); 
         $(this).tab('show'); 
        }); 
       }); 

      </script> 
      <script src="/app/assets/javascripts/jquery-1.js" type="text/javascript"> 
      </script> 
      <script src="/app/assets/javascripts/bootstrap.js" type="text/javascript"> 
      </script> 
      <script src="/app/assets/javascripts/jquery.js" type="text/javascript"> 
      </script> 
      <script src="https://d3js.org/topojson.v1.min.js"> 
      </script> 
      <script src="/app/assets/javascripts/sorttable.js" type="text/javascript"> 
      </script> 
      <script src="/app/assets/javascripts/d3.min.js" type="text/javascript"> 
      </script> 
      <script src="/app/assets/javascripts/FileSaver.min.js" type="text/javascript"> 
      </script> 
      <script src="/app/assets/javascripts/crossfilter.v1.min.js"> 
      </script> 
      <script src="/app/assets/javascripts/retention.js"> 
      </script> 
      <script src="/app/assets/javascripts/cohort.js"> 
      </script> 
      <script src="/app/assets/javascripts/map.js"> 
      </script> 
      <script src="/app/assets/javascripts/filter.js"> 
      </script> 
      <script type="text/javascript"> 
        $(function() { 
         $('#tab a').click(function(e) { 
          e.preventDefault(); 
          $(this).tab('show'); 
         }); 
        }); 

      </script> 
      <script type="text/javascript"> 
       $(function() { 
        $('#tab a').click(function(e) { 
         e.preventDefault(); 
         $(this).tab('show'); 
        }); 
       }); 

      </script> 

     </div> 
    </div> 
</body> 

Herokuのに押し、私はエラーを取得:私はまだでルビーからいくつかの変数を追加する必要が

remote: !  Precompiling assets failed. 
remote: ! 
remote: !  Push rejected, failed to compile Ruby app. 
remote: 
remote: !  Push failed 

を、B私はこれがうまくいくと思った。私はRailsの新機能ですが、htmlページをセットアップするには良い方法がありますか?私はこのコードをこのアプリのPython版で動作させていました。

Herokuのログ

2016-10-10T20:12:20.148407+00:00 heroku[slug-compiler]: Slug compilation started 
2016-10-10T20:12:20.148413+00:00 heroku[slug-compiler]: Slug compilation finished 
2016-10-10T20:12:20.278402+00:00 heroku[web.1]: Restarting 
2016-10-10T20:12:20.278949+00:00 heroku[web.1]: State changed from up to starting 
2016-10-10T20:12:22.031227+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2016-10-10T20:12:22.428123+00:00 app[web.1]: [2016-10-10 20:12:22] FATAL SignalException: SIGTERM 
2016-10-10T20:12:22.428134+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:174:in `select' 
2016-10-10T20:12:22.428135+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:174:in `block in 
start' 
2016-10-10T20:12:22.428136+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:32:in `start' 
2016-10-10T20:12:22.428136+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:162:in `start' 
2016-10-10T20:12:22.428137+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/handler/webrick.r 
b:34:in `run' 
2016-10-10T20:12:22.428138+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:286:in 
`start' 
2016-10-10T20:12:22.428138+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/s 
erver.rb:80:in `start' 
2016-10-10T20:12:22.428142+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/c 
ommands_tasks.rb:80:in `block in server' 
2016-10-10T20:12:22.428144+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/c 
ommands_tasks.rb:75:in `tap' 
2016-10-10T20:12:22.428145+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/c 
ommands_tasks.rb:75:in `server' 
2016-10-10T20:12:22.428146+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/c 
ommands_tasks.rb:39:in `run_command!' 
2016-10-10T20:12:22.428146+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands.r 
b:17:in `<top (required)>' 
2016-10-10T20:12:22.428147+00:00 app[web.1]: bin/rails:4:in `require' 
2016-10-10T20:12:22.428148+00:00 app[web.1]: bin/rails:4:in `<main>' 
2016-10-10T20:12:22.428306+00:00 app[web.1]: [2016-10-10 20:12:22] INFO going to shutdown ... 
2016-10-10T20:12:22.428392+00:00 app[web.1]: [2016-10-10 20:12:22] INFO WEBrick::HTTPServer#start done. 
2016-10-10T20:12:22.466742+00:00 app[web.1]: => Booting WEBrick 
2016-10-10T20:12:22.466746+00:00 app[web.1]: => Rails 4.2.5.1 application starting in production on http://0.0.0.0:24845 

2016-10-10T20:12:22.466747+00:00 app[web.1]: => Run `rails server -h` for more startup options 
2016-10-10T20:12:22.466748+00:00 app[web.1]: => Ctrl-C to shutdown server 
2016-10-10T20:12:22.466749+00:00 app[web.1]: Exiting 
2016-10-10T20:12:22.573198+00:00 heroku[web.1]: Process exited with status 143 
2016-10-10T20:12:23.456119+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 38099 -e production` 
2016-10-10T20:12:27.186333+00:00 app[web.1]: [2016-10-10 20:12:27] INFO WEBrick 1.3.1 
2016-10-10T20:12:27.186387+00:00 app[web.1]: [2016-10-10 20:12:27] INFO ruby 2.2.4 (2015-12-16) [x86_64-linux] 
2016-10-10T20:12:27.186771+00:00 app[web.1]: [2016-10-10 20:12:27] INFO WEBrick::HTTPServer#start: pid=3 port=38099 
2016-10-10T20:12:27.581049+00:00 heroku[web.1]: State changed from starting to up 
2016-10-10T20:13:15.340999+00:00 heroku[router]: at=info method=GET path="/?hmac=b0022c2db596e836cdda8c136ee40b9f30f1333 
b30f9bd86c06ee6e344096f0f&protocol=https%3A%2F%2F&shop=test-cust.myshopify.com&timestamp=1476130393" host=shop-test-2.he 
rokuapp.com request_id=442d86b3-025d-46f9-9687-a6ee20384685 fwd="71.239.189.250" dyno=web.1 connect=1ms service=669ms st 
atus=200 bytes=5014 
2016-10-10T20:13:15.322516+00:00 app[web.1]: unknown OID 2278: failed to recognize type of 'retention_data'. It will be 
treated as String. 
2016-10-10T20:45:47.821178+00:00 heroku[slug-compiler]: Slug compilation started 
2016-10-10T20:46:03.679549+00:00 heroku[router]: at=info method=GET path="/?hmac=a311893f64b3cb8689c24c1bdd962bcc1bede1e 
258b538982bdf883595ca76e3&protocol=https%3A%2F%2F&shop=test-cust.myshopify.com&timestamp=1476132362" host=shop-test-2.he 
rokuapp.com request_id=40dc5c2f-21ba-4ae7-9051-be7ff9d05eac fwd="71.239.189.250" dyno=web.1 connect=11ms service=413ms s 
tatus=200 bytes=5014 
2016-10-10T20:46:48.233219+00:00 heroku[slug-compiler]: Slug compilation started 
2016-10-10T20:47:29.144311+00:00 heroku[web.1]: Idling 
2016-10-10T20:47:29.145034+00:00 heroku[web.1]: State changed from up to down 
2016-10-10T20:47:31.536543+00:00 heroku[web.1]: Stopping all processes with SIGTERM 
2016-10-10T20:47:32.209321+00:00 app[web.1]: [2016-10-10 20:47:32] FATAL SignalException: SIGTERM 
2016-10-10T20:47:32.209331+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:174:in `select' 
2016-10-10T20:47:32.209334+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:174:in `block in 
start' 
2016-10-10T20:47:32.209335+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:32:in `start' 
2016-10-10T20:47:32.209335+00:00 app[web.1]: /app/vendor/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:162:in `start' 
2016-10-10T20:47:32.209336+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/handler/webrick.r 
b:34:in `run' 
2016-10-10T20:47:32.209336+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:286:in 
`start' 
2016-10-10T20:47:32.209337+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/s 
erver.rb:80:in `start' 
2016-10-10T20:47:32.209338+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/c 
ommands_tasks.rb:80:in `block in server' 
2016-10-10T20:47:32.209339+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/c 
ommands_tasks.rb:75:in `tap' 
2016-10-10T20:47:32.209339+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/c 
ommands_tasks.rb:75:in `server' 
2016-10-10T20:47:32.209340+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands/c 
ommands_tasks.rb:39:in `run_command!' 
2016-10-10T20:47:32.209340+00:00 app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/commands.r 
b:17:in `<top (required)>' 
2016-10-10T20:47:32.209341+00:00 app[web.1]: bin/rails:4:in `require' 
2016-10-10T20:47:32.209342+00:00 app[web.1]: bin/rails:4:in `<main>' 
2016-10-10T20:47:32.209424+00:00 app[web.1]: [2016-10-10 20:47:32] INFO going to shutdown ... 
2016-10-10T20:47:32.209467+00:00 app[web.1]: [2016-10-10 20:47:32] INFO WEBrick::HTTPServer#start done. 
2016-10-10T20:47:32.243638+00:00 app[web.1]: => Booting WEBrick 
2016-10-10T20:47:32.243644+00:00 app[web.1]: => Run `rails server -h` for more startup options 
2016-10-10T20:47:32.243643+00:00 app[web.1]: => Rails 4.2.5.1 application starting in production on http://0.0.0.0:38099 

2016-10-10T20:47:32.243644+00:00 app[web.1]: => Ctrl-C to shutdown server 
2016-10-10T20:47:32.243645+00:00 app[web.1]: Exiting 
2016-10-10T20:47:32.356245+00:00 heroku[web.1]: Process exited with status 143 
2016-10-10T20:51:09.010661+00:00 heroku[slug-compiler]: Slug compilation started 
+2

アセットのプリコンパイルに失敗した理由はありませんか?ヒント:Herokuログを見てください。 – MarsAtomic

+0

エラーログをオペレーションに追加しましたが、問題がtbhであるかどうかはまだわかりません – Adam12344

+1

開発マシンのアセットを 'bundle exec rake assets:precompile'でプリコンパイルできます。たぶん、より良いエラーメッセージが表示されます。 –

答えて

2

私は決まり文句をドラッグするつもりですが、私はそれが適用さだと思う:

「の相関は因果関係を意味するものではありません。」

この例外が発生する前に、Railsプロジェクトにアセットを追加している可能性がありますが、そのアセットが例外の原因であるとは限りません。 SIGTERMは、あなたのプロジェクトの外から発信されたUNIXシグナルで、多かれ少なかれ "黙ってください"と言います。あなたのアプリは、これを行うだけで、丁寧にこの要求に対応しています。

Heroku dyno managerがこの信号のソースである可能性があります。 Herokuのフリー層を使用している場合は、その層のダイノスの睡眠時間が強制的にかかるため、この問題に随時対応します。

を実行して、労働者のダイナモを再起動してみてください:この問題は、ダイノマネージャから来ていないオフのチャンスで

heroku restart worker.1 

、生産グレードの提供にWebサーバーを変更してみてください。 Herokuは具体的にはcautions against using WEBrickですが、開発はOKですが、生産にはあまり適していません。現在開発中であるかもしれませんが、最終的に本番環境で実行される予定の同じ設定で作業したい場合があります。

私はここではWEBrickが問題だとは思わないが、あなたはあとでではなく、あなたのカモを一列に並べるかもしれない。

+0

heroku restart worker.1とheroku restartが修正されていないようです。 'puma'を探しています – Adam12344

+1

@ Adam12344 gemファイルをチェックし、 'rake'が含まれていることを確認してください。次のステップは、Nilsがコメントで提案したように、資産をプリコンパイルしようとすることです。私はまだ資産を追加することが必然的にSIGTERMを引き起こしたとは考えていませんが、ますます可能性が増しています。 – MarsAtomic

+0

私はすべての資産を取り除き、再び働きました。私はそれらを1つずつ追加して、それがsorttableであることを発見しました.jsはコンパイルからそれを保っている唯一のファイルです。幸いにも、私はもはやこのファイルは必要ありません – Adam12344

関連する問題