0

注意完成请求是多么耗时

Started GET "/" for 127.0.0.1 at 2011-10-19 20:45:38 +0800
Processing by MainController#index as HTML
Book Load (0.9ms)  SELECT "books".* FROM "books" 
Rendered application/_product.html.erb (66.8ms)
Rendered main/index.html.erb within layouts/application (158.7ms)
Rendered application/_header.html.erb (45.6ms)
Rendered application/_search_cart.html.erb (1.6ms)
Completed 200 OK in 350ms (Views: 347.9ms | ActiveRecord: 0.9ms)

任何想法?

我还有什么选择将 webrick 替换为默认服务器!

4

1 回答 1

0

您可以尝试使用 rails-dev-boost gem (https://github.com/thedarkone/rails-dev-boost),将以下内容添加到您的 gemfile 并进行捆绑安装

gem 'rails-dev-boost', :git => 'https://github.com/thedarkone/rails-dev-boost.git', :require => 'rails_development_boost'

但请注意,在更改 lib/ 文件夹、初始化程序等中的代码时,仍然需要重新启动服务器。

您也可以尝试让 mongrel 作为开发服务器工作。根据您的 ruby​​/rails 组合,以下内容会发生变化。更多线索和信息:http: //jan.varwig.org/archive/rails-3-and-mongrel,这应该适用于 rails 3.1 和 ruby​​ 1.9.2 组合

group :development, :test do
  # ...
  # http://jan.varwig.org/archive/rails-3-and-mongrel
  gem 'mongrel', '>= 1.2.0.pre2'
end
于 2012-01-17T10:27:32.027 回答