Rails terminal clogged with loading bootstrap files - ruby-on-rails

I am using Rails 4 and the bootstrap 2 gem (haven't figure out is there is an official / well supported bootstrap 3 gem yet) for my web app.
But the problem is as I'm trying to work through the server logs in my terminal, it is clogged up with a bunch of bootstrap get requests:
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/bootstrap_and_overrides.css?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/messages.css?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/styles.css?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/dataTables/jquery.dataTables.css?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/dataTables/jquery.dataTables.bootstrap.css?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-alert.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-modal.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-dropdown.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-transition.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-scrollspy.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-popover.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-tab.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-tooltip.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-button.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-collapse.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-typeahead.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-carousel.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/twitter/bootstrap/bootstrap-affix.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/bootstrap.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/dataTables/jquery.dataTables.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-12-16 13:48:59 -0800
Started GET "/assets/task_sessions.js?body=1" for 127.0.0.1 at 2013-12-16 13:49:00 -0800
Started GET "/assets/tasks.js?body=1" for 127.0.0.1 at 2013-12-16 13:49:00 -0800
Started GET "/assets/welcome.js?body=1" for 127.0.0.1 at 2013-12-16 13:49:00 -0800
Is there any way to not make those things appear for every single request to make debugging and going through the log easier?
Thanks!

There's a gem called quiet_assets which does pretty much what you want.
https://github.com/evrone/quiet_assets
Simply add gem 'quiet_assets', group: :development to your Gemfile and run bundle install
By default it suppresses your assets log messages but you can optionally switch it back on.

Related

How to reduce the frequency of /sidekiq/stats command invocations

How to reduce the frequency of /sidekiq/stats command invocations when the Sidekiq dashboard is kept openend. Is there a way to set the frequency in which the /stats command should be fired.
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:08:59 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:04 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:10 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:14 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:20 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:24 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:30 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:34 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:39 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:44 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:50 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:09:54 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:00 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:04 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:09 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:14 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:19 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:24 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:29 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:34 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:39 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:44 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:49 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:54 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:10:59 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:04 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:09 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:14 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:19 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:24 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:29 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:34 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:39 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:44 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:49 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:54 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:11:59 +0530
Started GET "/sidekiq/stats" for 127.0.0.1 at 2019-01-18 13:12:04 +0530
Do you see the "Polling Interval" slider? Slide it.

how to load multiple files with single HTTP request

In my Rails project, I send a request , these are many files what I need,
Started GET "/assets/bootstrap.min.css?body=1" for 127.0.0.1 at 2015-05-29 11:55:09 +0800
Started GET "/assets/customized_bootstrap.css?body=1" for 127.0.0.1 at 2015-05-29 11:55:09 +0800
Started GET "/assets/jquery.ui.core.css?body=1" for 127.0.0.1 at 2015-05-29 11:55:09 +0800
Started GET "/assets/jquery.ui.theme.css?body=1" for 127.0.0.1 at 2015-05-29 11:55:09 +0800
Started GET "/assets/jquery.ui.accordion.css?body=1" for 127.0.0.1 at 2015-05-29 11:55:09 +0800
Started GET "/assets/jquery.ui.menu.css?body=1" for 127.0.0.1 at 2015-05-29 11:55:09 +0800
Started GET "/assets/jquery.ui.autocomplete.css?body=1" for 127.0.0.1 at 2015-05-29 11:55:09 +0800
Started GET "/assets/jquery.ui.button.css?body=1" for 127.0.0.1 at 2015-05-29 11:55:09 +0800
Started GET "/assets/jquery.ui.datepicker.css?body=1" for 127.0.0.1 at 2015-05-29 11:55:09 +0800
how to load these files via single GET HTTP request ?
This is how the Rails asset pipeline works in the "development" environment. When the app is running in the "production" environment, javascript and css get combined and minified into a single file. Check out the RailsGuide on this topic.

Rails dataTables have to reload page

I'm using dataTables in a Rails app. I have a model called site.
The index for site uses a dataTable to list the sites.
When I first load the index page
http://localhost:3000/sites
The dataTable doesn't work. There are no console errors.
If I reload the page, it works!
During the reload, the console shows entries like this:
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:29 -0600
Started GET "/assets/bootstrap.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:29 -0600
Started GET "/assets/bootstrap-editable.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:29 -0600
Started GET "/assets/ColVis.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:29 -0600
Started GET "/assets/datetimepicker.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:29 -0600
Started GET "/assets/datepicker.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:29 -0600
Started GET "/assets/dataTables/bootstrap/3/jquery.dataTables.bootstrap.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:29 -0600
Started GET "/assets/jquery.qtip.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:30 -0600
Started GET "/assets/jquery.treeTable.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:30 -0600
Started GET "/assets/TableTools.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:30 -0600
Started GET "/assets/TableTools_JUI.css?body=1" for 127.0.0.1 at 2014-07-13 17:24:30 -0600
...
Thanks for the help!
Do you use gem turbolink? If yes, that can be the reason of it, because it do not reload the whole page, just partially. You can solve it in two different ways:
Don't use turbolink (but your website will be slower)
Move your datatable init code into page:change,
like this in application.js:
$(document).on("page:change", function() {
$('#yourtable').dataTable();
});

rails s hangs - Hartl Rails Guide

I'm a beginner and just installed everything on my system (new) per the Hartl guide. I am having issues with 'rails s' - it hangs and doesn't continue so I'm unable to do anything except end the command line processes and start over. Here's where it stops:
$ rails s
=> Booting WEBrick
=> Rails 4.0.2 application starting in development on (localhost3000)
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2014-01-03 00:13:30] INFO WEBrick 1.3.1
[2014-01-03 00:13:30] INFO ruby 2.0.0 (2013-11-22) [x86_64-darwin13.0.0]
[2014-01-03 00:13:30] INFO WEBrick::HTTPServer#start: pid=22805 port=3000
Started GET "/microposts/new" for 127.0.0.1 at 2014-01-03 00:13:38 -0800
ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by MicropostsController#new as HTML
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Rendered microposts/_form.html.erb (71.3ms)
Rendered microposts/new.html.erb within layouts/application (90.6ms)
Completed 200 OK in 237ms (Views: 222.5ms | ActiveRecord: 0.4ms)
Started GET "/assets/users.css?body=1" for 127.0.0.1 at 2014-01-03 00:13:39 -0800
Started GET "/assets/microposts.css?body=1" for 127.0.0.1 at 2014-01-03 00:13:39 -0800
Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2014-01-03 00:13:39 -0800
Started GET "/assets/users.js?body=1" for 127.0.0.1 at 2014-01-03 00:13:39 -0800
Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2014-01-03 00:13:39 -0800
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2014-01-03 00:13:39 -0800
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2014-01-03 00:13:39 -0800
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-01-03 00:13:39 -0800
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-01-03 00:13:39 -0800
Started GET "/assets/microposts.js?body=1" for 127.0.0.1 at 2014-01-03 00:13:40 -0800
Started GET "/microposts/new" for 127.0.0.1 at 2014-01-03 00:19:11 -0800
Processing by MicropostsController#new as HTML
Rendered microposts/_form.html.erb (6.1ms)
Rendered microposts/new.html.erb within layouts/application (8.0ms)
Completed 200 OK in 19ms (Views: 17.9ms | ActiveRecord: 0.0ms)
Started GET "/assets/scaffolds.css?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
Started GET "/assets/microposts.js?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
Started GET "/assets/users.css?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
Started GET "/assets/microposts.css?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
Started GET "/assets/users.js?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-01-03 00:19:12 -0800
As stated, rails server takes over the terminal when you run it. You've got to start a new terminal session. A quit step in ubuntu/linux is the combination
CTL+SHIFT+T
or
CTL+ALT+T
When you run "rails s" it takes over the terminal and doesn't return. You should open a second terminal if you want to run other commands at the same time.
In production you usually setup rails with apache or nginx. See this guide for more information:
http://rubyonrails.org/deploy
I had this same question at first. It look like it's hanging but that actually means that it's running. As long as it looks like it's hanging it is running the server and you can open the localhost:3000 to see your webpage locally. When you're ready to shutdown the server and get your prompt back you can click control c on the mac.

Diagnosing the cause of slow view rendering

I'm not sure when this started, but something unusual is happening in my app (run locally on a development machine). Suddenly I am seeing messages like:
Started GET "/" for 127.0.0.1 at 2013-03-10 12:10:24 +1300
Processing by PagesController#home as HTML
Rendered pages/home.html.erb within layouts/application (2.4ms)
Completed 200 OK in 3242ms (Views: 3241.4ms | ActiveRecord: 0.0ms)
As you can see 3 seconds to load the home page (a relatively simple page) ... We're not talking a hard page reload .. just clicking on the "home" link again from another page.
Not really sure where to start here, but this is my application.rb:
#config/boot.rb is loaded
require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
Bundler.require(*Rails.groups(:assets => %w(development test)))
end
module Goodsounds
class Application < Rails::Application
config.encoding = "utf-8"
config.filter_parameters += [:password]
config.assets.initialize_on_precompile = false
config.assets.enabled = true
config.action_controller.assets_dir = "#{File.dirname(File.dirname(__FILE__))}/public"
config.assets.version = '1.0'
config.autoload_paths += Dir["#{Rails.root}/lib/modules"]
config.assets.paths += Dir["#{Rails.root}/app/assets/fonts/*"]
config.assets.precompile += %w( .svg .eot .woff .ttf )
end
end
...and dev.rb:
Goodsounds::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
Paperclip.options[:command_path] = "/usr/bin/"
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.raise_delivery_errors = true
# set delivery method to :smtp, :sendmail or :test
config.action_mailer.delivery_method = :smtp
# these options are only needed if you choose smtp delivery
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
# Raise exception on mass assignment protection for Active Record models
config.active_re
cord.mass_assignment_sanitizer = :strict
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
config.active_record.auto_explain_threshold_in_seconds = 0.5
# Do not compress assets
config.assets.compress = false
# Expands the lines which load the assets
config.assets.debug = true
end
EDIT:
OK, Here is what I am seeing on new relic. Doesn't really help me though. Any thoughts?
Oh and what I learned from Chrome timeline:
Send Request - Details
Duration 0 (at 655 ms)
Resource localhost
Request Method GET
Receive Response - Details
Duration 0.043 ms (at 4.17 s)
Resource localhost
Status Code 200
MIME Type text/html
Receive Data - Details
Duration 176.329 ms (at 4.17 s)
Self Time 7.037 ms
CPU Time 176.329 ms
Aggregated Time 061.194 ms114.664 ms0.471 ms0
Resource localhost
Encoded Data Length 303 Bytes
Used Heap Size 29.1 MB (+5.7 MB)
Finish Loading - Details
Duration 0 (at 4.35 s)
Resource localhost
By the way I disabled the quiet_assets gem to see what I could discover in the terminal.. again.. not helpful:
Started GET "/" for 127.0.0.1 at 2013-03-10 21:46:40 +1300
Processing by PagesController#home as HTML
Rendered pages/home.html.erb within layouts/application (43.4ms)
Completed 200 OK in 3501ms (Views: 3480.9ms | ActiveRecord: 19.4ms)
Started GET "/assets/dataTables/jquery.dataTables.bootstrap.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /dataTables/jquery.dataTables.bootstrap.css - 304 Not Modified (11ms)
Started GET "/assets/chosen.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /chosen.css - 304 Not Modified (5ms)
Started GET "/assets/select2.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /select2.css - 304 Not Modified (4ms)
Started GET "/assets/autocomplete.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /autocomplete.css - 304 Not Modified (1ms)
Started GET "/assets/branches.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /branches.css - 304 Not Modified (2ms)
Started GET "/assets/bubbles.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bubbles.css - 304 Not Modified (1ms)
Started GET "/assets/business_show.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /business_show.css - 304 Not Modified (1ms)
Started GET "/assets/chunkyfive_font.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /chunkyfive_font.css - 304 Not Modified (1ms)
Started GET "/assets/consumer_show.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /consumer_show.css - 304 Not Modified (2ms)
Started GET "/assets/datatable_styling.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /datatable_styling.css - 304 Not Modified (1ms)
Started GET "/assets/datepicker.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /datepicker.css - 304 Not Modified (2ms)
Started GET "/assets/devise_links.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /devise_links.css - 304 Not Modified (1ms)
Started GET "/assets/dispenser_show.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /dispenser_show.css - 304 Not Modified (1ms)
Started GET "/assets/fonts.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /fonts.css - 304 Not Modified (1ms)
Started GET "/assets/forms.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /forms.css - 304 Not Modified (2ms)
Started GET "/assets/gmaps4rails.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /gmaps4rails.css - 304 Not Modified (1ms)
Started GET "/assets/jquery-ui-1.10.0.custom.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jquery-ui-1.10.0.custom.css - 304 Not Modified (2ms)
Started GET "/assets/jumbotrons.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jumbotrons.css - 304 Not Modified (1ms)
Started GET "/assets/layout.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /layout.css - 304 Not Modified (1ms)
Started GET "/assets/open_sans.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /open_sans.css - 304 Not Modified (2ms)
Started GET "/assets/popover.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /popover.css - 304 Not Modified (1ms)
Started GET "/assets/reviews.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /reviews.css - 304 Not Modified (1ms)
Started GET "/assets/spinner.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /spinner.css - 304 Not Modified (2ms)
Started GET "/assets/style_show.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /style_show.css - 304 Not Modified (2ms)
Started GET "/assets/style_show_reviews.css?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /style_show_reviews.css - 304 Not Modified (2ms)
Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jquery.js - 304 Not Modified (3ms)
Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jquery_ujs.js - 304 Not Modified (3ms)
Started GET "/assets/ui.custom.min.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /ui.custom.min.js - 304 Not Modified (1ms)
Started GET "/assets/bootstrap-transition.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-transition.js - 304 Not Modified (5ms)
Started GET "/assets/bootstrap-affix.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-affix.js - 304 Not Modified (3ms)
Started GET "/assets/bootstrap-alert.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-alert.js - 304 Not Modified (4ms)
Started GET "/assets/bootstrap-button.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-button.js - 304 Not Modified (5ms)
Started GET "/assets/bootstrap-carousel.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-carousel.js - 304 Not Modified (3ms)
Started GET "/assets/bootstrap-collapse.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-collapse.js - 304 Not Modified (3ms)
Started GET "/assets/bootstrap-dropdown.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-dropdown.js - 304 Not Modified (3ms)
Started GET "/assets/bootstrap-modal.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-modal.js - 304 Not Modified (3ms)
Started GET "/assets/bootstrap-scrollspy.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-scrollspy.js - 304 Not Modified (3ms)
Started GET "/assets/bootstrap-tab.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-tab.js - 304 Not Modified (3ms)
Started GET "/assets/bootstrap-tooltip.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-tooltip.js - 304 Not Modified (5ms)
Started GET "/assets/bootstrap-popover.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-popover.js - 304 Not Modified (52ms)
Started GET "/assets/bootstrap-typeahead.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap-typeahead.js - 304 Not Modified (3ms)
Started GET "/assets/bootstrap.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /bootstrap.js - 304 Not Modified (13ms)
Started GET "/assets/gmaps4rails/gmaps4rails.base.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /gmaps4rails/gmaps4rails.base.js - 304 Not Modified (1ms)
Started GET "/assets/gmaps4rails/gmaps4rails.bing.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /gmaps4rails/gmaps4rails.bing.js - 304 Not Modified (2ms)
Started GET "/assets/gmaps4rails/gmaps4rails.googlemaps.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /gmaps4rails/gmaps4rails.googlemaps.js - 304 Not Modified (2ms)
Started GET "/assets/gmaps4rails/gmaps4rails.mapquest.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /gmaps4rails/gmaps4rails.mapquest.js - 304 Not Modified (2ms)
Started GET "/assets/gmaps4rails/gmaps4rails.openlayers.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /gmaps4rails/gmaps4rails.openlayers.js - 304 Not Modified (2ms)
Started GET "/assets/jqueryplugins/addresspicker.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jqueryplugins/addresspicker.js - 304 Not Modified (2ms)
Started GET "/assets/jqueryplugins/browser_detect.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jqueryplugins/browser_detect.js - 304 Not Modified (3ms)
Started GET "/assets/jqueryplugins/charts.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jqueryplugins/charts.js - 304 Not Modified (2ms)
Started GET "/assets/jqueryplugins/jquery.alphanumeric.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jqueryplugins/jquery.alphanumeric.js - 304 Not Modified (1ms)
Started GET "/assets/jqueryplugins/jquery.formrestrict.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jqueryplugins/jquery.formrestrict.js - 304 Not Modified (2ms)
Started GET "/assets/jqueryplugins/jquery.lazyload.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jqueryplugins/jquery.lazyload.js - 304 Not Modified (1ms)
Started GET "/assets/jqueryplugins/raty.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /jqueryplugins/raty.js - 304 Not Modified (2ms)
Started GET "/assets/dataTables/jquery.dataTables.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /dataTables/jquery.dataTables.js - 304 Not Modified (13ms)
Started GET "/assets/dataTables/jquery.dataTables.bootstrap.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /dataTables/jquery.dataTables.bootstrap.js - 304 Not Modified (63ms)
Started GET "/assets/lib/abstract-chosen.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /lib/abstract-chosen.js - 304 Not Modified (12ms)
Started GET "/assets/lib/select-parser.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /lib/select-parser.js - 304 Not Modified (12ms)
Started GET "/assets/chosen.jquery.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /chosen.jquery.js - 304 Not Modified (8ms)
Started GET "/assets/chosen-jquery.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /chosen-jquery.js - 304 Not Modified (9ms)
Started GET "/assets/select2.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /select2.js - 304 Not Modified (7ms)
Started GET "/assets/highcharts.js?body=1" for 127.0.0.1 at 2013-03-10 21:46:44 +1300
Served asset /highcharts.js - 304 Not Modified (1ms)
By the way, as per a suggestion on reddit I precompiled assets and ran the server. Seeing fantastic speeds:
Processing by PagesController#home as HTML
Rendered pages/home.html.erb within layouts/application (1.1ms)
Completed 200 OK in 6ms (Views: 5.4ms | ActiveRecord: 0.0ms)
Ok not sure this is providing any help or not but the major delay is happening between these two lines of code in the stack:
From: /home/funkdified/.rvm/gems/ruby-1.9.3-p392#goodsounds/gems/actionpack-3.2.13.rc1/lib/action_controller/metal/implicit_render.rb # line 5 ActionController::ImplicitRender#send_action:
3: def send_action(method, *args)
4: ret = super
=> 5: default_render unless response_body
6: ret
7: end
[2] pry(#<PagesController>)> next
MAJOR DELAY
From: /home/funkdified/.rvm/gems/ruby-1.9.3-p392#goodsounds/gems/actionpack-3.2.13.rc1/lib/action_controller/metal/implicit_render.rb # line 6 ActionController::ImplicitRender#send_action:
3: def send_action(method, *args)
4: ret = super
5: default_render unless response_body
=> 6: ret
7: end
Ok, I figured it out (at long last). Without changing any of my actual assets I am now seeing this is development:
Started GET "/" for 127.0.0.1 at 2013-03-11 23:14:33 +1300
Processing by PagesController#home as HTML
Rendered pages/home.html.erb within layouts/application (1.3ms)
It turns out the delay was being caused by config.assets.debug = true inside of development.rb. Setting this to false resolves the problem.
Looks like the Rails core team debated turning this off by default, but decided against the idea. In the future I'd love to see them put something in the comment section of development.rb to tip off users of the potential for significant delays.
May I suggest the following:
# Expands the lines which load the assets
# May cause significant delays in view rendering
Great, they heard me muttering and updated rails!
The same issue has appeared for me in rails 4.1+. Abram's answer is only partially complete.
You can leave config.assets.debug = true but should disable new assets verification feature
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = false
Solution with config.assets.debug disabled only works because it compiles assets once and assets are verified once. Assets verification is where the most of the time is spent.
If you're coming from rails 3.2.13 note that a bunch of people have experienced this issue and reverting to 3.2.12 seems to resolve it. You can find more info here on github.
In my case disabling config.assets.debug sped things up a little, but reverting to 3.2.12 dropped request time from around 4 seconds to around 250ms.
Take a look at NewRelic.com - it costs, but the free trial will allow you to totally dissect your application and work out where any bottlenecks are.
Aside from New Relic run through the usual checks, e.g. when did it start? What have you changed recently? Have you upgraded Rails and/or any gems? Check out and run a few previous versions from your source control and try and work out specifically which commit caused the issue.
Does the issue happen with all browsers? Try firing up the Chrome timeline viewer and you'll be able to see if the browser is getting stuck up on a particular piece of JavaScript.
Also try switching your local dev web server to thin, does the issue persist?
Good luck!
Are you on OSX and serving via .local?
If so, gonna throw the post I found in my comments as a solution:
Subdomain constraint (Rails 3) makes local server (thin) SO SLOW

Resources