This project is archived and is in readonly mode.

#4370 ✓committed
Santiago Pastorino

uninitialized constant Arel after reload!

Reported by Santiago Pastorino | April 12th, 2010 @ 04:36 PM | in 3.0.2

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

Comments and changes to this ticket

  • Santiago Pastorino

    Santiago Pastorino April 12th, 2010 @ 04:38 PM

    I've used --dev to create the application

  • Santiago Pastorino

    Santiago Pastorino April 12th, 2010 @ 04:57 PM

    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
    
  • Santiago Pastorino

    Santiago Pastorino April 12th, 2010 @ 06:17 PM

    • 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

  • Santiago Pastorino

    Santiago Pastorino April 12th, 2010 @ 08:15 PM

    • State changed from “verified” to “committed”
    • Assigned user set to “Santiago Pastorino”
  • Alex Le

    Alex Le May 28th, 2010 @ 07:44 AM

    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.

  • Santiago Pastorino

    Santiago Pastorino May 29th, 2010 @ 06:21 PM

    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
    >>
    
  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages