1

Heroku and my production environment are not loading the jQuery JavaScript Library leading to the following "Failed to load resource: the server responded with a status of 404 (Not Found)".

All the research I have done point to a asset pipeline issues, but i have confirmed the assets are being precompiled localy and delivered to Heroku.

I have performed / tested the following and still having issues.

  1. arranged my asset order in application.js
  2. changed production.rb: config.assets.compile = true , from default config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
  3. ran the command: rake assets:precompile then git push heroku master
  4. ran the command: RAILS_ENV=production bundle exec rake assets:precompile
  5. ran the command: heroku run rake assets:precompile --app appName
  6. added the gem 'rails_serve_static_assets' as mentioned in heroku documentation
  7. precompiled production assets and pushhed and compiled on Heroku. RAILS_ENV=production bundle exec rake assets:precompile
  8. Debugged in Heroku: confirmed precompiled assets loaded to public/assets $ heroku run bash $ ls public/assets
  9. Still getting the 404 error in my console "Failed to load resource: the server responded with a status of 404 (Not Found)" specifically naming the Jquery javascript library. Hit a road block on what I am doing wrong. Any help is appreciated.

My problem seems similar to this issue with no answer although i am getting a 404 error.

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

code

application.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

production.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"]

gemfile

            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

view

            <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>

logs

            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
Community
  • 1
  • 1
AJC
  • 65
  • 7

2 Answers2

1

Are any jquery type things loading? bootstrap? turbolinks?, etc?

I'd try sticking a CDN to generic jquery link in there & see what happens ... if that works can you move your stuff to a CDN host just to see if it's something specific.

Also, do you have the log files put out there...

Mirv - Matt
  • 553
  • 7
  • 22
  • no jquery loading ... bootstrap is loading fine. I will edit to add logs now THANKS – AJC Jan 12 '17 at 23:36
  • Are the advanced bootstrap stuff working or just generic? Have you used capybara? Have you tried stripping down to an extremely basic jquery file like, a hello world pop up or print to log once the $.document loads? `$( document ).ready(function() { console.log( "ready!" ); });` type of thing inside heroku...just to make sure heroku isn't rejecting a chunk of the code? – Mirv - Matt Jan 12 '17 at 23:49
  • Thanks for the suggestion i performed a test using a generic jquery pop which and it did work in heroku. Bootstrap is working including the advanced. This is suggesting an issue with the chunk of code. Anything specific to look for as this worked fine in dev environment. I have edited the question to include view. – AJC Jan 13 '17 at 15:30
  • The polygons are not loading so it is failing on the ajax call. I have not used capybara will look into now. – AJC Jan 13 '17 at 15:47
  • Only other thing I was thinking was precompile settings, you were missing a file setting in the rails side..but they might have depreciated it ... http://stackoverflow.com/questions/8012434/what-is-the-purpose-of-config-assets-precompile – Mirv - Matt Jan 13 '17 at 15:52
  • I run on heroku too - I was seeing someone else who mentioned the 404 code wasn't coming from the heroku system, but rather being generated by the jquery itself as it couldn't get something else that it needed - which might be inline with your turbolinks/bootstrap.js working. Any luck running the heroku logs yet? It's all just guesswork till we get some sort of log...which means you're down to individually importing jquery code chunk by chunk till you find it. – Mirv - Matt Jan 13 '17 at 16:19
  • The error that sticks out is the 500...I assume the ".each" error just stems from the active record part not returning a collection. Is that where the ajax/jquery you posted originally about would be interacting? Can you stub the "polygons" or whatever in order to just have them feed a single response through & then see if you can get the app working without the jquery? Also, can you explicitly confirm the jquery versus hosted from the CDN does or does not work? – Mirv - Matt Jan 13 '17 at 23:35
1

The 404 error is due to the inclusion of this file in the application.js //= require map_theme/vendor/jquery.localize

Ultimately the issues/500 error was with a piece of code and incorrectly seeding the production db. I had locations where IDs were not the same as dev environment. So the the code was unable to find the files and jquery failed.

AJC
  • 65
  • 7