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.

uninitialized constant Arel after reload!

#4370

With the latest Rails master version and Arel version i get this

santiago@debian:/tmp/test_app$ ruby script/rails c
Loading development environment (Rails 3.0.0.beta3)
>> Post.where(:id => 1)
=> []
>> reload!
Reloading...
=> true
>> Post.where(:id => 1)
NameError: uninitialized constant Arel
    from /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/base.rb:1032:in `arel_table'
    from /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/base.rb:1027:in `unscoped'
    from /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/named_scope.rb:30:in `scoped'
    from /home/santiago/Documentos/WyeWorks/Proys/rails/activerecord/lib/active_record/base.rb:405:in `where'
    from (irb):3

Reported by Santiago Pastorino · April 12th, 2010 @ 04:36 PM

State: committed
Milestone: 3.0.2
Assigned to: Santiago Pastorino Santiago Pastorino
Importance: none

Activity

  1. Santiago Pastorino
    Santiago Pastorino

    I've used --dev to create the application

    April 12th, 2010 @ 04:38 PM

  2. Santiago Pastorino
    Santiago Pastorino
    santiago@debian:/tmp/test_app$ ruby script/rails c
    Loading development environment (Rails 3.0.0.beta3)
    >> ActiveSupport::Dependencies.autoloaded_constants 
    => []
    >> Post.where(:id => 1)
    => []
    >> ActiveSupport::Dependencies.autoloaded_constants 
    => ["Arel", "Observable", "Singleton", "Post"]
    >> reload!
    Reloading...
    => true
    >> ActiveSupport::Dependencies.autoloaded_constants 
    => []
    >> Post.where(:id => 1)
    NameError: uninitialized constant Arel
    

    April 12th, 2010 @ 04:57 PM

  3. Santiago Pastorino
    Santiago Pastorino
    • Tag changed from activerecord, arel, reload! to activerecord, arel, patch, reload!

    This commit solve the issue http://github.com/spastorino/rails/commit/66c3e06d4dc90eaa44e57128d...
    Working on a regresion test

    April 12th, 2010 @ 06:17 PM

  4. Santiago Pastorino
    Santiago Pastorino
    • State changed from verified to committed
    • Assigned user set to Santiago Pastorino

    April 12th, 2010 @ 08:15 PM

  5. Alex Le
    Alex Le

    I still run into this issue on ruby-1.9.2-head ("$ruby -v" gives ruby 1.9.3dev (2010-05-28 trunk 28047) [x86_64-darwin10.3.0]) and Rails 3.0.0.beta3:

    alexle:notebooks sr3d$ rails console
    Loading development environment (Rails 3.0.0.beta3)
    ruby-1.9.2-head > Sortable
     => Sortable(divider_id: decimal, note_id: decimal, list_id: decimal, notebook_id: decimal, id: integer, account_id: integer, position: integer, created_at: datetime, updated_at: datetime) 
    ruby-1.9.2-head > Arel
     => Arel 
    ruby-1.9.2-head > reload!;
    ruby-1.9.2-head >   Arel
    Reloading...
    NameError: uninitialized constant Arel
        from (irb):4
        from /Users/sr3d/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.0.beta3/lib/rails/commands/console.rb:47:in `start'
        from /Users/sr3d/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.0.beta3/lib/rails/commands/console.rb:8:in `start'
        from /Users/sr3d/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.0.beta3/lib/rails/commands.rb:34:in `<top (required)>'
        from script/rails:9:in `require'
        from script/rails:9:in `<main>'
    

    I also noticed the extra 2 spaces at the prompt after the reload! call.

    May 28th, 2010 @ 07:44 AM

  6. Santiago Pastorino
    Santiago Pastorino

    Works for me, i don't know ... latest rails code from github?

    santiago@debian:/tmp/myapp$ ruby -v
    ruby 1.9.3dev (2010-05-25 trunk 27996) [x86_64-linux]
    santiago@debian:/tmp/myapp$ rails c
    Loading development environment (Rails 3.0.0.beta3)
    >> Post
    => Post(id: integer, created_at: datetime, updated_at: datetime)
    >> Arel
    => Arel
    >> reload!
    Reloading...
    => true
    >> Arel
    => Arel
    >>
    

    May 29th, 2010 @ 06:21 PM

  7. Jeremy Kemper