【问题标题】:rails development environment not reloading views on changerails 开发环境不会重新加载有关更改的视图
【发布时间】:2011-02-17 09:51:55
【问题描述】:

我在我的开发环境中搞砸了,现在我每次对视图或控制器进行修改时都必须重新启动我的服务器。有很多小的变化,这很痛苦。

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

任何帮助都将不胜感激,因为它会减慢我的发展速度。

谢谢

这是我的环境.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

【问题讨论】:

    标签: ruby-on-rails


    【解决方案1】:

    在我的 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

    【讨论】:

    • 现在感觉好傻 :) 盯着它看了很长时间,并没有发现它是假的。需要另一双眼睛来发现愚蠢。感谢您指出。
    猜你喜欢
    • 2012-12-15
    • 2011-09-30
    • 1970-01-01
    • 1970-01-01
    • 2014-08-22
    • 2022-09-28
    • 1970-01-01
    • 2020-08-01
    • 2017-04-25
    相关资源
    最近更新 更多