rails开发环境没有重新加载关于更改的视图

时间:2011-02-17 09:51:55

标签: ruby-on-rails

我在我的开发环境中捣乱了,现在我每次修改视图或控制器时都必须重新启动服务器。这是一个很多小变化的痛苦。

现在即使我的development.rb回到原来的那个,视图,控制器也需要重新启动才能看到更改。 我不确定发生了什么。

任何帮助都会非常感激,因为它会减缓我的发展。

由于

这是我的environment.rb:

config.time_zone = 'Eastern Time (US & Canada)'
config.cache_classes = true
ENV['NLS_LANG']='american_america.AL32UTF8'
config.i18n.default_locale = :en
config.gem "authlogic"
config.gem "matthuhiggins-foreigner", :lib => "foreigner"
config.gem "memcache-client", :lib => "memcached"
end

require "will_paginate"
require "RedCloth"
require "authlogic"
require 'memcached'

我的development.rb看起来像:

config.cache_classes = true
config.whiny_nils = true
config.action_controller.consider_all_requests_local = true
config.action_view.debug_rjs                         = true
config.action_controller.perform_caching             = false
#cache only the models to avoid nil.include? errors in development mode.
config.load_once_paths += %W(  #{RAILS_ROOT}/app/models  )

# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false

config.after_initialize do
Workling::Remote.dispatcher = Workling::Remote::Runners::StarlingRunner.new
end

我尝试使用详细模式启动mongrel_start,但它没有帮助:

mongrel_rails start -B
** Starting Mongrel listening at 0.0.0.0:3000
** Installing debugging prefixed filters. Look in log/mongrel_debug for the files.
** Starting Rails with development environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart).
** Rails signals registered.  HUP => reload (without restart).  It might not work well.
** Mongrel 1.1.5 available at 0.0.0.0:3000

1 个答案:

答案 0 :(得分:5)

在我的development.rb

# 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 webserver when you make code changes.
config.cache_classes = false

所以,我想你必须把它false