Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

When a new Rails application is created by "rails new", autoload_paths instead of load_paths should be put in the generated application.rb

#5204

I have just switched my existing Rails 3.0.0.beta4 application to 3.0.0.rc.
And I got an error,

/Users/[user_name]/.rvm/gems/ruby-1.9.2-rc2/gems/railties-3.0.0.rc/lib/rails/railtie/configuration.rb:76:in method_missing': undefined methodload_paths' for #<Rails::Application::Configuration:0x00000102aba970> (NoMethodError)

In order to compare the difference, I have created a new Rails application by executing "rails new [application_name]". But "load_paths" was written in there.

So I looked at railties-3.0.0.beta4 gem and railties-3.0.0.rc gem. By tracing the code, I found that in Rails::Engine::Configuration, attr_writer is changed from load_paths to autoload_paths.

I think that in order to avoid the confusion, autoload_paths should be written in application.rb when a new 3.0.0.rc application is created by "rails new".

Reported by Tadatoshi Takahashi · July 27th, 2010 @ 12:52 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Tadatoshi Takahashi
    Tadatoshi Takahashi

    P.S. I have just found that unless there is a Gemfile specifying rails 3.0.0.rc, rails command in any directory still uses the one for 3.0.0.beta4.

    I apologize that I may have written the ticket too early and that I should investigate my environment more.

    Here is what I get in the directory with the Gemfile:
    $ rails --version Rails 3.0.0.rc

    And here is what I get in the directory without Gemfile:
    $ rails --version Rails 3.0.0.beta4

    July 27th, 2010 @ 01:06 AM

  2. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid
    • Importance changed from to Low

    July 27th, 2010 @ 02:19 AM

  3. Jeff Dean
    Jeff Dean

    Is there any reason not to deprecate load_paths? These seemingly arbitrary name changes, with no deprecation warnings, make it harder for people to upgrade. If I write the deprecation warning will you accept it?

    July 30th, 2010 @ 05:41 AM

  4. Robert Pankowecki
    Robert Pankowecki

    I had the same issue. It took me some time to fine that the method is now called ActiveSupport::Dependencies.autoload_paths instead of ActiveSupport::Dependencies.load_paths. Please use deprecations when making such changes.

    August 3rd, 2010 @ 01:50 PM

  5. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 11th, 2010 @ 10:58 AM

  6. bingbing