AndrewLngdn
AndrewLngdn

Reputation: 73

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?

Upvotes: 0

Views: 30

Answers (1)

Josh
Josh

Reputation: 8596

I would have done a global search for "insight_access" that seems the be the file that it couldn't find (from the first line of the error).

Upvotes: 1

Related Questions