从应用程序中删除观察者后未初始化的常量VideoObserver错误

时间:2019-06-09 15:29:07

标签: ruby-on-rails caching

我已经安装了rails-observer gem。我当前的rails -v是5.2。但是我发现它没有用,选择删除它。但是NameError未初始化的常量videoobserver出现在我的页面上,但刷新几次后消失了。错误消息突出显示了该行:

CoreExt::ActiveSupport.without_bootsnap_cache { super }

我的application.rb不再具有观察者的配置,我也没有videoobserver模型。也从gem文件中删除了gem。可能引起问题的原因是什么?

require_relative 'boot'

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Niibori
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.2

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration can go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded after loading
    # the framework and any gems in your application.
  end
end
   # If the constant was actually loaded, something else went wrong?
     raise(e) if from_mod.const_defined?(const_name)
     CoreExt::ActiveSupport.without_bootsnap_cache { super } <-- the errorline
   end

   # Signature has changed a few times over the years; easiest to not

1 个答案:

答案 0 :(得分:0)

将其从gemfile中删除后,应再次运行bundle。您也可以尝试其他人喜欢的gem uninstall rails-observer

How to remove gem from Ruby on Rails application?

作为对此的回答: How to remove gems from Rails project?

也许您想运行bundle clean