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.

undefined method `table_alias' - scaffold index action

#3688

Installed Rails 3 pre today. As a test app, I went for creating a cookbook. After creating the application directories, I used the scaffold command to create a Recipe model, and a corresponding controller and the views. After creating the database and table, I launched my application through the script/server command. The default rails page came up fine, however going to http://localhost:3000/recipes I receive a NoMethodError.

undefined method table_alias' for #<Arel::Table:0x60c57a0><br/> Rails.root: C:/Users/Aaron/Documents/programming/rails/cookbook

Application Trace | Framework Trace | Full Trace
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/relation.rb:185:in references_eager_loaded_tables?'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/relation.rb:46:inall'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/base.rb:651:in send'<br/> C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/base.rb:651:infind'
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-3.0.pre/lib/active_record/base.rb:674:in all'<br/> C:/Users/Aaron/Documents/programming/rails/cookbook/app/controllers/recipes_controller.rb:6:inindex'
C:1:in __send__'<br/> C:1:ininstrument'

Line 6 refers to:
@recipes = Recipe.all

Reported by agmcleod · January 13th, 2010 @ 01:36 AM

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

Activity

  1. Matija Folnovic
    Matija Folnovic

    it seems to me it's working with latest arel ...

    January 14th, 2010 @ 09:42 PM

  2. agmcleod
    agmcleod

    I ran git submodule update, and reinstalled rails. Here's the output

    Successfully built RubyGem
    Name: arel Version: 0.2.pre File: arel-0.2.pre.gem Successfully installed arel-0.2.pre
    1 gem installed
    The system cannot find the path specified.
    INSTALLING activesupport
    Successfully installed activesupport-3.0.pre
    1 gem installed
    INSTALLING activemodel

    The rest of the gems install without any errors. I do see the gem folder of arel in C:\Ruby\lib\ruby\gems\1.8\gems\arel-0.2.pre. The gemspec file is there as well. Note I am using Windows 7 RC x64

    January 14th, 2010 @ 11:37 PM

  3. Matija Folnovic
    Matija Folnovic

    I think this ticket can help you getting newest arel ( arel you have probably isn't newest )

    #3633 Undefined method, 'having', for Arel gem

    January 15th, 2010 @ 08:39 AM

  4. José Valim
    José Valim
    • State changed from new to invalid

    You need the newest ARel.

    February 21st, 2010 @ 07:36 PM