title: What is the best way to load files from the lib folder that add methods to ~existing~ classes in Rails 3?
body: <p>I am using <code>config.autoload_paths</code> in a way very similar to this <a href="https://stackoverflow.com/questions/3356742/best-way-to-load-module-class-from-lib-folder-in-rails-3">related question</a> to load classes from the lib directory in a Rails 3 project.  </p>
  
  <p>Specifically, I've added these lines to the config/application.rb file: </p>
  
  <pre><code>config.autoload_paths += %W(#{config.root}/lib)
  config.autoload_paths += Dir["#{config.root}/lib/**/"]
  </code></pre>
  
  <p>However, this method is not working for me for <em>existing</em> classes.  When I add a file like lib/extensions/string.rb: </p>
  
  <pre><code>class String
    def foo
      puts "foo"
    end
  end
  </code></pre>
  
  <p>I get an <code>undefined method 'foo' for "":String</code>error.  Through various searches I've got the sense that this problem has to do with the lazy loading of these files.  I tried using <code>config.eager_load_paths</code> but was not able to get that to work. </p>