javascript - Heroku jQuery JavaScript 库未加载 - 404 错误

标签 javascript jquery ruby-on-rails ruby heroku

Heroku 和我的生产环境没有加载 jQuery JavaScript 库导致以下“无法加载资源:服务器响应状态为 404(未找到)”。

我所做的所有研究都指向 Assets 管道问题,但我已确认 Assets 正在本地预编译并交付给 Heroku。

我已经执行/测试了以下内容,但仍然存在问题。

  1. 在 application.js 中安排了我的 Assets 顺序
  2. 更改了 production.rb:config.assets.compile = true,从默认的 config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
  3. 运行命令:rake assets:precompile 然后 git push heroku master
  4. 运行命令:RAILS_ENV=production bundle exec rake assets:precompile
  5. 运行命令:heroku run rake assets:precompile --app appName
  6. 添加了 heroku 文档中提到的 gem 'rails_serve_static_assets'
  7. 预编译生产 Assets 并在 Heroku 上推送和编译。 RAILS_ENV=production bundle exec rake assets:precompile
  8. 在 Heroku 中调试:确认预编译 Assets 加载到 public/assets $ heroku 运行 bash $ ls 公共(public)/ Assets
  9. 仍然在我的控制台中收到 404 错误“无法加载资源:服务器响应状态为 404(未找到)”,具体命名为 Jquery javascript 库。 在我做错的事情上遇到障碍。任何帮助表示赞赏。

虽然我收到 404 错误,但我的问题似乎与此问题类似但没有答案。

Jquery not working in Production & Heroku but works perfectly well in development

代码

应用程序.js

            //= require jquery
            //= require jquery_ujs
            //= require turbolinks
            //= require map_theme/vendor/modernizr.custom
            //= require map_theme/vendor/matchMedia
            //= require map_theme/vendor/bootstrap
            //= require map_theme/vendor/jquery.storageapi
            //= require map_theme/vendor/jquery.easing
            //= require map_theme/vendor/animo
            //= require map_theme/vendor/jquery.slimscroll.min
            //= require map_theme/vendor/screenfull
            //= require map_theme/vendor/jquery.localize
            //= require map_theme/demo/demo-rtl
            //= require map_theme/vendor/index
            //= require map_theme/vendor/jquery.classyloader.min
            //= require map_theme/vendor/moment-with-locales.min
            //= require map_theme/app

生产.rb

              config.cache_classes = true
              config.eager_load = true
              config.consider_all_requests_local       = false
              config.action_controller.perform_caching = true
              config.serve_static_files = true
              config.assets.js_compressor = :uglifier
              config.assets.compile = false
              config.assets.digest = true
              config.log_level = :debug
              config.i18n.fallbacks = true
              config.active_support.deprecation = :notify
              config.log_formatter = ::Logger::Formatter.new
              config.active_record.dump_schema_after_migration = false
              config.middleware.use('PartyFoul::Middleware')
              config.secret_key_base = ENV["SECRET_KEY_BASE"]

gem 文件

            gem 'rails', '4.2.5.1'
            gem 'sass-rails', '~> 5.0'
            gem 'uglifier', '>= 1.3.0'
            gem 'coffee-rails', '~> 4.1.0'
            gem 'jquery-rails'
            gem 'turbolinks'
            gem 'jbuilder', '~> 2.0'
            gem 'sdoc', '~> 0.4.0', group: :doc
            gem "figaro"
            gem 'geocoder'
            gem 'seed_dump'
            gem 'gmaps4rails'
            gem 'devise'
            gem 'puma'
            gem 'activeadmin', github: 'activeadmin'
            gem 'filterrific'
            gem 'sprockets-rails', '2.3.3'
            gem 'by_star', git: "git://github.com/radar/by_star"    
            gem 'colorize'
            gem 'carrierwave'
            gem 'mandrill-api'
            gem 'active_model_serializers', '~> 0.10.0'
            gem 'moving_average'
            gem 'party_foul'
            gem 'rails_serve_static_assets'
            group :production do
                gem 'pg'
                gem 'rails_12factor'
            end
            group :development, :test do
              gem 'byebug'
              gem 'sqlite3'
            end

查看

            <script>
            var map;
            var infoWindow;       

              // Map Display options
              function initMap() {
                map = new google.maps.Map(document.getElementById('map'), {
                  zoom: 9,
                  center: {lat: 42.05, lng: -70.25},
                  mapTypeId: google.maps.MapTypeId.SATELLITE,
                  scrollwheel:  false,
                  scaleControl: false,
                });
                var polygons = [];
                $.ajax({
                    url: '/species_filter',
                    type: "get", //send it through get method
                    data:{target_species:$('#species_select').val()},
                    success: function(response) {
                      console.log(response);
                      for (var i = 0; i < response.length ; i++) {
                        polygons.push(new google.maps.Polygon({
                        paths: response[i].cfile,
                        strokeColor: '#F7F8FF',
                        strokeOpacity: 0.8,
                        strokeWeight: .35,
                        fillColor: response[i].color,
                        fillOpacity: 0.45,
                        editable: false,  
                        map: map,
                        loc: response[i].location,
                        rep: response[i].reports,
                        mavg: response[i].movingavg
                      }));
                        polygons[polygons.length-1].setMap(map);
                        var p = polygons[i];
                         google.maps.event.addListener(p, 'click', function (event) {
                          console.log(this);

                  // console.log(location_reports);               
                   var contentString = '<table><thead><tr><th>Date</th><th>Target Species</th><th>Vessel Name</th><th>Primary Method</th><th>Catch Total</th><th>Trip Summary</th></tr></thead><tbody><b>' + this.loc.short_name +'</b> <br>' + this.loc.long_name +'<br> <br>';
                   for(var j=0;j<this.rep.length; j++){
                    contentString += '<tr><td>' +this.rep[j].rep.date + '</td> <td>' +this.rep[j].rep.target_species + '</td><td>' +this.rep[j].vessel_name + '</td><td>' +this.rep[j].rep.primary_method + '</td><td>' +this.rep[j].rep.catch_total + '</td><td>' +this.rep[j].rep.trip_summary + '</td></tr>';
                   };
                   contentString +='</tbody></table>';

                  // Replace the info window's content and position.
                  infoWindow = new google.maps.InfoWindow;
                  infoWindow.setContent(contentString);
                  infoWindow.setPosition(event.latLng);
                  google.maps.event.addListener(infoWindow, 'domready', function() {

                   var iwOuter = $('.gm-style-iw');

                   var iwBackground = iwOuter.prev();
                   // Remove the background shadow DIV
                   iwBackground.children(':nth-child(2)').css({'display' : 'none'});
                   // Remove the white background DIV
                   iwBackground.children(':nth-child(4)').css({'display' : 'none'});
                   iwOuter.parent().parent().css({left: '115px'});
                   iwBackground.children(':nth-child(1)').attr('style', function(i,s){ return s + 'left: 76px !important;'});
                   iwBackground.children(':nth-child(3)').attr('style', function(i,s){ return s + 'left: 155px !important;'});
                   iwBackground.children(':nth-child(3)').find('div').children().css({'box-shadow': 'rgba(72, 181, 233, 0.6) 0px 1px 6px', 'z-index' : '1'});

                   var iwCloseBtn = iwOuter.next();
                    // Apply the desired effect to the close button
                    iwCloseBtn.css({
                      opacity: '1', // by default the close button has an opacity of 0.7
                      right: '44px', top: '8px', // button repositioning
                      // border: '7px solid #48b5e9', // increasing button border and new color
                      'border-radius': '13px', // circular effect
                      'box-shadow': '0 0 5px #3990B9' // 3D effect to highlight the button
                      });

                    iwCloseBtn.mouseout(function(){
                      $(this).css({opacity: '1'});
                    });
                    });
                  infoWindow.open(map);
                        }); 

                google.maps.event.addListener(p, 'mouseover',function (event){
                  $("#locdetails").css("display", "block");
                  $( "#locdetails" ).append( "<div class='hoverrow'> <div class='hoverclass'>Location</div> <div class='hoverclass'>Average Catch Per Trip</div> <div class='hoverclass'>Reports posted past 7 days</div> </div> <div class='hoverrow'><div class='hoverclass'>"+ this.loc.short_name +"</div>" +"<div class='hoverclass'>" + this.mavg +  "</div>"+"<div class='hoverclass'>" + this.rep.length +  "</div></div>" );
                  map.data.revertStyle();
                  this.setOptions({
                    strokeColor: '#F7F8FF',
                    strokeWeight: 3 ,
                    fillOpacity: 0.75
                      });
                        });
                    google.maps.event.addListener(p, 'mouseout',function (event){
                      $("#locdetails").css("display", "none");
                      $( "#locdetails" ).empty();
                    map.data.revertStyle();
                    this.setOptions({
                        strokeColor: '#F7F8FF',
                      strokeOpacity: 0.8,
                      strokeWeight: .35,
                      fillOpacity: 0.5,
                    });
                        });
                      };
                    },
                    error: function(xhr) {
                    }
                  }); 
                }

                $('#species_select').change(function(){
                  initMap();
                  infoWindow.close();
                });
            </script>

            <script async defer
                 src="https://maps.googleapis.com/maps/api/js?key=""&callback=initMap">
            </script>

日志

            2017-01-13T15:34:39.920225+00:00 app[web.1]:   Report Load (1.3ms)  SELECT DISTINCT(tide) FROM "reports" WHERE "reports"."user_id" = $1  [["user_id", 3]]
            2017-01-13T15:34:39.944172+00:00 app[web.1]:   Location Load (1.0ms)  SELECT  "locations".* FROM "locations" WHERE "locations"."id" = $1 LIMIT 1  [["id", 15]]
            2017-01-13T15:34:39.945545+00:00 app[web.1]:   CACHE (0.0ms)  SELECT  "locations".* FROM "locations" WHERE "locations"."id" = $1 LIMIT 1  [["id", 6]]
            2017-01-13T15:34:39.946432+00:00 app[web.1]:   CACHE (0.0ms)  SELECT  "locations".* FROM "locations" WHERE "locations"."id" = $1 LIMIT 1  [["id", 15]]
            2017-01-13T15:34:39.938746+00:00 app[web.1]:   Location Load (2.7ms)  SELECT  "locations".* FROM "locations" WHERE "locations"."id" = $1 LIMIT 1  [["id", 6]]
            2017-01-13T15:34:39.949118+00:00 app[web.1]:   Location Load (0.8ms)  SELECT  "locations".* FROM "locations" WHERE "locations"."id" = $1 LIMIT 1  [["id", 7]]
            2017-01-13T15:34:39.947292+00:00 app[web.1]:   CACHE (0.0ms)  SELECT  "locations".* FROM "locations" WHERE "locations"."id" = $1 LIMIT 1  [["id", 6]]
            2017-01-13T15:34:39.954280+00:00 app[web.1]:   Rendered layouts/_navbar.html.erb (2.0ms)
            2017-01-13T15:34:39.950113+00:00 app[web.1]:   CACHE (0.0ms)  SELECT  "locations".* FROM "locations" WHERE "locations"."id" = $1 LIMIT 1  [["id", 7]]
            2017-01-13T15:34:39.950936+00:00 app[web.1]:   Rendered reports/index.html.erb within layouts/application (72.2ms)
            2017-01-13T15:34:39.954731+00:00 app[web.1]: Completed 200 OK in 98ms (Views: 63.7ms | ActiveRecord: 20.2ms)
            2017-01-13T15:34:40.100226+00:00 heroku[router]: at=info method=GET path="/assets/lighthouse2-ad6fdcbcefd4cb9d7254996e97d636d1010a916771ce0142bd8d2c0769f2b70b.jpg" host=currents.herokuapp.com request_id=887c16fd-2968-4772-8a3f-8ab815a033df fwd="199.253.243.3" dyno=web.1 connect=0ms service=1ms status=304 bytes=48
            2017-01-13T15:34:41.085541+00:00 heroku[router]: at=info method=GET path="/maps" host=currents.herokuapp.com request_id=9b3b88a2-dd64-4fe0-b14b-c9393f4a1db3 fwd="199.253.243.3" dyno=web.1 connect=1ms service=25ms status=200 bytes=13348
            2017-01-13T15:34:41.031038+00:00 app[web.1]: Started GET "/maps" for 199.253.243.3 at 2017-01-13 15:34:41 +0000
            2017-01-13T15:34:41.034594+00:00 app[web.1]: Processing by MapsController#index as HTML
            2017-01-13T15:34:41.036794+00:00 app[web.1]:   User Load (0.8ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1  ORDER BY "users"."id" ASC LIMIT 1  [["id", 3]]
            2017-01-13T15:34:41.048084+00:00 app[web.1]:   Report Load (1.0ms)  SELECT "reports".* FROM "reports"
            2017-01-13T15:34:41.049807+00:00 app[web.1]:   Rendered maps/index.html.erb within layouts/application (4.9ms)
            2017-01-13T15:34:41.051861+00:00 app[web.1]:   Rendered layouts/_navbar.html.erb (1.1ms)
            2017-01-13T15:34:41.052294+00:00 app[web.1]: Completed 200 OK in 18ms (Views: 12.8ms | ActiveRecord: 1.8ms)
            2017-01-13T15:34:41.220850+00:00 app[web.1]: Started GET "/species_filter?target_species=Any" for 199.253.243.3 at 2017-01-13 15:34:41 +0000
            2017-01-13T15:34:41.224007+00:00 app[web.1]: Processing by MapsController#filter_by_species as */*
            2017-01-13T15:34:41.224055+00:00 app[web.1]:   Parameters: {"target_species"=>"Any"}
            2017-01-13T15:34:41.239336+00:00 app[web.1]:   User Load (13.3ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1  ORDER BY "users"."id" ASC LIMIT 1  [["id", 3]]
            2017-01-13T15:34:41.244027+00:00 app[web.1]:   Location Load (1.2ms)  SELECT "locations".* FROM "locations"
            2017-01-13T15:34:41.255948+00:00 app[web.1]:    (1.0ms)  SELECT AVG("reports"."catch_keepers") AS average_catch_keepers, date AS date FROM "reports" WHERE "reports"."location_id" = $1 AND (date >= '2017-01-06') AND (date < '2017-01-13') GROUP BY "reports"."date"  ORDER BY "reports"."date" DESC  [["location_id", 1]]
            2017-01-13T15:34:41.258770+00:00 app[web.1]:    (0.8ms)  SELECT AVG("reports"."catch_keepers") AS average_catch_keepers, date AS date FROM "reports" WHERE "reports"."location_id" = $1 AND (date >= '2017-01-05') AND (date < '2017-01-12') GROUP BY "reports"."date"  [["location_id", 1]]
            2017-01-13T15:34:41.258905+00:00 app[web.1]: ----moving average
            2017-01-13T15:34:41.258927+00:00 app[web.1]: 0.0
            2017-01-13T15:34:41.258951+00:00 app[web.1]: 0.0
            2017-01-13T15:34:41.258931+00:00 app[web.1]: ----previous moving average
            2017-01-13T15:34:41.258969+00:00 app[web.1]: ---movingavg
            2017-01-13T15:34:41.258999+00:00 app[web.1]: {:movingavg=>0.0, :color=>"#4562A8"}
            2017-01-13T15:34:41.261129+00:00 app[web.1]:   Report Load (0.8ms)  SELECT "reports".* FROM "reports" WHERE "reports"."location_id" = $1 AND (date >= '2017-01-06') AND (date < '2017-01-13')  ORDER BY "reports"."date" DESC  [["location_id", 1]]
            2017-01-13T15:34:41.266026+00:00 app[web.1]: Completed 500 Internal Server Error in 42ms (ActiveRecord: 17.9ms)
            2017-01-13T15:34:41.670858+00:00 heroku[router]: at=info method=GET path="/species_filter?target_species=Any" host=currents.herokuapp.com request_id=51400dbb-d5cb-4eef-a0fd-162e96339a1b fwd="199.253.243.3" dyno=web.1 connect=0ms service=424ms status=500 bytes=1669
            2017-01-13T15:34:41.639677+00:00 app[web.1]: 
            2017-01-13T15:34:41.639685+00:00 app[web.1]: NoMethodError (undefined method `each' for #<ActionDispatch::Request::Session:0x007f05c5a61ae0>):
            2017-01-13T15:34:41.639686+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/http/parameter_filter.rb:51:in `call'
            2017-01-13T15:34:41.639686+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/http/parameter_filter.rb:11:in `filter'
            2017-01-13T15:34:41.639687+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/party_foul-1.5.5/lib/party_foul/issue_renderers/rails.rb:15:in `session'
            2017-01-13T15:34:41.639687+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/party_foul-1.5.5/lib/party_foul/issue_renderers/rack.rb:8:in `comment_options'
            2017-01-13T15:34:41.639689+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/party_foul-1.5.5/lib/party_foul/exception_handler.rb:31:in `run'
            2017-01-13T15:34:41.639688+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/party_foul-1.5.5/lib/party_foul/issue_renderers/base.rb:46:in `comment'
            2017-01-13T15:34:41.639688+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/party_foul-1.5.5/lib/party_foul/exception_handler.rb:67:in `update_issue'
            2017-01-13T15:34:41.639689+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/party_foul-1.5.5/lib/party_foul/processors/sync.rb:9:in `handle'
            2017-01-13T15:34:41.639689+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/party_foul-1.5.5/lib/party_foul/exception_handler.rb:10:in `handle'
            2017-01-13T15:34:41.639690+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/party_foul-1.5.5/lib/party_foul/middleware.rb:11:in `rescue in call'
            2017-01-13T15:34:41.639691+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/party_foul-1.5.5/lib/party_foul/middleware.rb:8:in `call'
            2017-01-13T15:34:41.639691+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:35:in `block in call'
            2017-01-13T15:34:41.639692+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `catch'
            2017-01-13T15:34:41.639692+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/warden-1.2.6/lib/warden/manager.rb:34:in `call'
            2017-01-13T15:34:41.639693+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/etag.rb:24:in `call'
            2017-01-13T15:34:41.639693+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:25:in `call'
            2017-01-13T15:34:41.639694+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
            2017-01-13T15:34:41.639694+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
            2017-01-13T15:34:41.639694+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/flash.rb:260:in `call'
            2017-01-13T15:34:41.639695+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
            2017-01-13T15:34:41.639695+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
            2017-01-13T15:34:41.639696+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
            2017-01-13T15:34:41.639696+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.5.1/lib/active_record/query_cache.rb:36:in `call'
            2017-01-13T15:34:41.639697+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
            2017-01-13T15:34:41.639697+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
            2017-01-13T15:34:41.639698+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
            2017-01-13T15:34:41.639698+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
            2017-01-13T15:34:41.639698+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
            2017-01-13T15:34:41.639699+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
            2017-01-13T15:34:41.639699+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
            2017-01-13T15:34:41.639700+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
            2017-01-13T15:34:41.639700+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
            2017-01-13T15:34:41.639700+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:38:in `call_app'
            2017-01-13T15:34:41.639701+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:20:in `block in call'
            2017-01-13T15:34:41.639701+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
            2017-01-13T15:34:41.639701+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/tagged_logging.rb:26:in `tagged'
            2017-01-13T15:34:41.639702+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/tagged_logging.rb:68:in `tagged'
            2017-01-13T15:34:41.639702+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:20:in `call'
            2017-01-13T15:34:41.639707+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
            2017-01-13T15:34:41.639709+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/engine.rb:518:in `call'
            2017-01-13T15:34:41.639702+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
            2017-01-13T15:34:41.639707+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
            2017-01-13T15:34:41.639708+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
            2017-01-13T15:34:41.639708+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
            2017-01-13T15:34:41.639709+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/railties-4.2.5.1/lib/rails/application.rb:165:in `call'
            2017-01-13T15:34:41.639707+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
            2017-01-13T15:34:41.639709+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
            2017-01-13T15:34:41.639710+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/configuration.rb:224:in `call'
            2017-01-13T15:34:41.639711+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/server.rb:271:in `block in run'
            2017-01-13T15:34:41.639710+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/server.rb:569:in `handle_request'
            2017-01-13T15:34:41.639711+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/server.rb:406:in `process_client'
            2017-01-13T15:34:41.639711+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/thread_pool.rb:114:in `call'
            2017-01-13T15:34:41.639712+00:00 app[web.1]:   vendor/bundle/ruby/2.2.0/gems/puma-3.4.0/lib/puma/thread_pool.rb:114:in `block in spawn_thread'
            2017-01-13T15:34:41.639712+00:00 app[web.1]: 
            2017-01-13T15:34:41.639712+00:00 app[web.1]: 
            2017-01-13T16:09:59.608738+00:00 heroku[web.1]: Idling
            2017-01-13T16:09:59.609122+00:00 heroku[web.1]: State changed from up to down
            2017-01-13T16:10:00.308786+00:00 heroku[web.1]: Stopping all processes with SIGTERM
            2017-01-13T16:10:00.324473+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
            2017-01-13T16:10:00.325921+00:00 app[web.1]: === puma shutdown: 2017-01-13 16:10:00 +0000 ===
            2017-01-13T16:10:00.325951+00:00 app[web.1]: - Goodbye!
            2017-01-13T16:10:00.325992+00:00 app[web.1]: Exiting
            2017-01-13T16:10:00.573756+00:00 heroku[web.1]: Process exited with status 0

最佳答案

是否加载了任何 jquery 类型的东西? Bootstrap ?涡轮链接?等?

我会尝试将 CDN 粘贴到那里的通用 jquery 链接,看看会发生什么......如果可行,您可以将您的东西移动到 CDN 主机,看看它是否是特定的东西。

此外,您是否将日志文件放在那里...

关于javascript - Heroku jQuery JavaScript 库未加载 - 404 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41624554/

相关文章:

jquery - 让 jQuery 在使用 EJS 模板创建的特定 div 中工作?

javascript - 迭代元素列表并根据内部文本删除它们上的光标样式

javascript - 如何在 Next.js 动态路由中避免 "id undefined"?

javascript - 重构 jquery 动画

javascript - jQuery:使 div 可点击以检查嵌套的复选框

ruby-on-rails - db :reset 后 Postgres 函数未保留

javascript - 不同函数中具有相同名称的数组

javascript - url.replace 有多个替换?

ruby-on-rails - Rails 简单表单按钮 ID

ruby-on-rails - 在设计 [Rails 4] 之上滚动 token 认证机制