简体   繁体   中英

How can I get more information about errors during the Rails Initialization method?

I was trying to uninstall a gem and remove code that depended on it. I removed the gem and the folder/files that it needed, but somewhere in the project there's code that's trying to load some stuff that didn't exist anymore:

LoadError: No such file to load -- /Users/andrewlangdon/workspace/chorus/app/permissions/insight_access
           depend_on at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:317
           depend_on at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:313
  require_dependency at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:225
         eager_load! at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/railties-3.2.18/lib/rails/engine.rb:444
                each at org/jruby/RubyArray.java:1613
         eager_load! at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/railties-3.2.18/lib/rails/engine.rb:443
                each at org/jruby/RubyArray.java:1613
         eager_load! at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/railties-3.2.18/lib/rails/engine.rb:441
            Finisher at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/railties-3.2.18/lib/rails/application/finisher.rb:53
       instance_exec at org/jruby/RubyBasicObject.java:1562
                 run at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/railties-3.2.18/lib/rails/initializable.rb:30
    run_initializers at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/railties-3.2.18/lib/rails/initializable.rb:55
                each at org/jruby/RubyArray.java:1613
    run_initializers at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/railties-3.2.18/lib/rails/initializable.rb:54
         initialize! at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/railties-3.2.18/lib/rails/application.rb:137
      method_missing at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/railties-3.2.18/lib/rails/railtie/configurable.rb:30
              (root) at /Users/andrewlangdon/workspace/chorus/config/environment.rb:5
             require at org/jruby/RubyKernel.java:1065
              (root) at /Users/andrewlangdon/workspace/chorus/spec/spec_helper.rb:1
             require at org/jruby/RubyKernel.java:1065
              (root) at /Users/andrewlangdon/workspace/chorus/spec/spec_helper.rb:4
                load at org/jruby/RubyKernel.java:1081
              (root) at /Users/andrewlangdon/workspace/chorus/spec/concerns/searchable_html_spec.rb:1
                each at org/jruby/RubyArray.java:1613
              (root) at /Users/andrewlangdon/workspace/chorus/spec/concerns/searchable_html_spec.rb:1
              (root) at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:1
     load_spec_files at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896
     load_spec_files at /Users/andrewlangdon/.rvm/gems/jruby-1.7.13/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896

I ended guessing that someone put a random require instead of following the normal pattern, and I found and removed the offending line after looking at each require call in the codebase.

Is there a better/easier way to get more info from this LoadError ?

我将对“ insight_access”进行全局搜索,该搜索似乎是它找不到的文件(从错误的第一行开始)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM