我有一个运行在rails 3.2.8上的应用程序。
只有当我重新启动服务器时,模型才会更新,对它们所做的任何更改都不会显示,直到重新启动服务器。
我正在开发中运行,并且关闭了缓存类。
还有其他人遇到这个问题吗?我真的很需要帮助。谢谢。
我已经重新安装了rvm、ruby和我的gemset。
我已经尝试了我所能想到的一切来解决它。感谢大家的关注。
编辑:我在下面添加了大量的配置细节...
development.rb
XXXXX::Application.configure do
config.cache_classes = false
config.whiny_nils = true
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.delivery_method = :sendmail
config.active_support.deprecation = :log
config.action_dispatch.best_standards_support = :builtin
config.active_record.mass_assignment_sanitizer = :strict
config.active_record.auto_explain_threshold_in_seconds = 0.5
config.assets.compress = false
config.assets.debug = true
config.action_mailer.default_url_options = { :host => 'yyyy.xxxx.net' }
#this is an attempt to fix the issues, didn't work
config.to_prepare do
['algorithm', 'key_dates', 'roles', 'status'].each do | file_name |
require "#{Rails.root}/app/models/user/#{file_name}.rb"
end
end
end
我的用户模型包含了一些模块,像这样:
class User < ActiveRecord::Base
include Status, Roles, KeyDates, Algorithm
#.....
end
模块的定义如下所示。
module User::Status
def self.included(base)
base.class_eval do
extend ClassMethods
include InstanceMethods
end
end
#.....
end
Application.rb
require File.expand_path('../boot', __FILE__)
require 'csv'
require 'rails/all'
if defined?(Bundler)
Bundler.require(*Rails.groups(:assets => %w(development test)))
end
module XXXXX
class Application < Rails::Application
config.encoding = "utf-8"
config.filter_parameters += [:password]
config.active_record.whitelist_attributes = true
config.assets.enabled = true
config.assets.version = '1.0'
config.autoload_paths += Dir["#{config.root}/app/models/**/"]
config.to_prepare do
Devise::Mailer.layout "mailout"
Devise::Mailer.helper :application
end
end
end
GemLock:
GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.8)
actionpack (= 3.2.8)
mail (~> 2.4.4)
actionpack (3.2.8)
activemodel (= 3.2.8)
activesupport (= 3.2.8)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.0)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.1.3)
activemodel (3.2.8)
activesupport (= 3.2.8)
builder (~> 3.0.0)
activerecord (3.2.8)
activemodel (= 3.2.8)
activesupport (= 3.2.8)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.8)
activemodel (= 3.2.8)
activesupport (= 3.2.8)
activesupport (3.2.8)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.8)
arel (3.0.2)
aws-sdk (1.5.2)
httparty (~> 0.7)
json (~> 1.4)
nokogiri (>= 1.4.4)
uuidtools (~> 2.1)
bcrypt-ruby (3.0.1)
builder (3.0.0)
cocaine (0.2.1)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.3.3)
devise (2.1.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.7)
railties (~> 3.1)
warden (~> 1.1.1)
devise_invitable (1.0.2)
devise (>= 2.0.0)
rails (~> 3.0)
erubis (2.7.0)
execjs (1.3.2)
multi_json (~> 1.0)
faker (1.0.1)
i18n (~> 0.4)
heroku (2.25.0)
launchy (>= 0.3.2)
netrc (~> 0.7.1)
rest-client (~> 1.6.1)
rubyzip
hike (1.2.1)
httparty (0.8.3)
multi_json (~> 1.0)
multi_xml
i18n (0.6.0)
journey (1.0.4)
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.7.5)
launchy (2.1.0)
addressable (~> 2.2.6)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
multi_json (1.3.6)
multi_xml (0.5.1)
mysql2 (0.3.11)
netrc (0.7.1)
nokogiri (1.5.2)
orm_adapter (0.0.7)
paperclip (2.7.0)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
cocaine (>= 0.0.2)
mime-types
pg (0.13.2)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.8)
actionmailer (= 3.2.8)
actionpack (= 3.2.8)
activerecord (= 3.2.8)
activeresource (= 3.2.8)
activesupport (= 3.2.8)
bundler (~> 1.0)
railties (= 3.2.8)
railties (3.2.8)
actionpack (= 3.2.8)
activesupport (= 3.2.8)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
redcarpet (1.17.2)
rest-client (1.6.7)
mime-types (>= 1.16)
rubyzip (0.9.8)
sass (3.1.18)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sequel (3.20.0)
sinatra (1.0)
rack (>= 1.0)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
taps (0.3.24)
rack (>= 1.0.1)
rest-client (>= 1.4.0, < 1.7.0)
sequel (~> 3.20.0)
sinatra (~> 1.0.0)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
uuidtools (2.1.2)
warden (1.1.1)
rack (>= 1.0)
PLATFORMS
ruby
DEPENDENCIES
aws-sdk
coffee-rails (~> 3.2.1)
devise
devise_invitable
faker
heroku
jquery-rails
mysql2
paperclip (~> 2.7)
pg
rails (= 3.2.8)
redcarpet (= 1.17.2)
sass-rails (~> 3.2.3)
sqlite3
taps
uglifier (>= 1.0.3)
vendor/plugins/whatever
插件中声明?当我更改插件中的模型/控制器时,也会发生同样的情况。 - Pablo