I've created a basic demo app in Rails 3.2.2 by using rails new demo. I then had a controller added with a single method which displays a view. It's taking on average 20+ seconds to render the page when I refresh. This obviously makes it impossible to develop, so I'm trying to figure out why and how I can fix this.
I should mention that I'm on a Macbook Air 2011 with 4GB of RAM and the SSD drive so I don't think my hardware has anything to do with the problem.
Running OSX Lion, Rails 3.2.2, & Ruby 1.9.3. Running locally via WEBrick
Update
The only changes I have made are to run rails generator Say hello goodbye
.
I then modified the hello.html.erb
to say Hello World!
Here is my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Started the server by typing rails server
Update 2
Noticed this oddity in the terminal window.. it takes 8 seconds from the starting GET to the GET on the first asset.
Started GET "/say/hello" for 127.0.0.1 at 2012-03-10 22:49:12 -0700
Processing by SayController#hello as HTML
Rendered say/hello.html.erb within layouts/application (0.1ms)
Completed 200 OK in 5ms (Views: 5.3ms | ActiveRecord: 0.0ms)
Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-03-10 22:49:20 -0700
Served asset /application.css - 200 OK (0ms)
THEN another 4 seconds for the next asset..
Started GET "/assets/say.css?body=1" for 127.0.0.1 at 2012-03-10 22:49:24 -0700
Served asset /say.css - 200 OK (0ms)
UPDATE 3.1
I have traced the problem down to WEBrick. I installed and used thin instead and my calls are very fast as expected. It would still be good to track down what the problem could be in case the WEBrick problem is a symptom of a larger problem..