`@active_record/relation' is not allowed as an instance variable name

98 views
Skip to first unread message

Bob Sleys

unread,
Aug 3, 2011, 11:52:11 AM8/3/11
to hobo...@googlegroups.com
Came into work this morning and fired up the app I've been working on and received the error message

`@active_record/relation' is not allowed as an instance variable name

I believe I did a bundle update last time I was working on the project and might not have restarted the server.  I get this error upon hitting the first hobo_controler

To try to figure out what was going on I created a fresh rvm gemset, installed hobo --pre and created a new test project.  It fired up fine so I add a resource 'hobo g resource organization'.  Once I went to /organizations I got the error again.  I tried adding something besides time stamps to the model fields, ie name :string, ran a migration and still get the error.

Did something change in hobo --pre last week that could be causing this?  or is it some other gem?

Gem listing

1.8.7@hobotest bsleys:~/projects/hobotest $ gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.9)
actionpack (3.0.9)
activemodel (3.0.9)
activerecord (3.0.9)
activeresource (3.0.9)
activesupport (3.0.9)
arel (2.0.10)
builder (2.1.2)
bundler (1.0.15)
dryml (1.3.0.pre31)
erubis (2.6.6)
hobo (1.3.0.pre31)
hobo_fields (1.3.0.pre31)
hobo_support (1.3.0.pre31)
i18n (0.5.0)
mail (2.2.19)
mime-types (1.16)
polyglot (0.3.2)
rack (1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
rails (3.0.9)
railties (3.0.9)
rake (0.9.2, 0.8.7)
rdoc (3.9.1)
sqlite3 (1.3.4)
thor (0.14.6)
treetop (1.4.10)
tzinfo (0.3.29)
will_paginate (3.0.pre4)


Bob

Bob Sleys

unread,
Aug 3, 2011, 11:56:48 AM8/3/11
to hobo...@googlegroups.com
Sorry ignore this...it has to do with the will_paginate pre4 problem already reported...should have looked that one over more closely.

Jaman

unread,
Aug 6, 2011, 10:09:48 AM8/6/11
to hobo...@googlegroups.com
Hi,

I also ran into this exact problem, however I've been unable to drop down to will_paginate 2.3.15 (which is installed) due to a dependency error when running bundle install:

Bundler could not find compatible versions for gem "will_paginate":
  In Gemfile:
    will_paginate (= 2.3.15)

    hobo (= 1.3.0.RC1) depends on
      will_paginate (3.0.pre4)

Did you get it to work?

Thanks in advance,
Ja

Bob Sleys

unread,
Aug 6, 2011, 8:02:37 PM8/6/11
to hobo...@googlegroups.com
In my case I had 2 version of will_paginate installed so I just uninstalled the higher level one and updated my bundle.  Simply uninstalling the currently used gem doesn't update bundle so you need to have it update after you remove the bad version and had a hard coded version to your gemfile so bundler sticks to that version and doesn't try to install the higher version again.

Bob

Quikin

unread,
Aug 8, 2011, 10:10:32 PM8/8/11
to Hobo Users
i have install

rails 3.0.9
hobo 1.3.0.RC
---------

$Hobo new simo

$hobo g resource objetivo_global objetivo_global:string
$hobo g migrate

$rails s

then view next error:

NameError in ObjetivoGlobalsController#index

`@active_record/relation' is not allowed as an instance variable name
Rails.root: /home/quike/pr/simo

thanks

Quike

Bob Sleys

unread,
Aug 8, 2011, 11:34:15 PM8/8/11
to hobo...@googlegroups.com
When you do the install of hobo it pulls in the latest version of will_paginate as a dependency.  The problem is the latest version is causing your problem. Add the following line to your gemfile.

gem "will_paginate", "3.0.pre2"

Then do a bundle install and check your installed versions of gems, gem list. You will probably see 2 version of will_paginate installed.  Do a gem uninstall will_paginate and select the one that isn't 3.0.pre2.  After that you should be good to go.

By adding the line above to the gemfile you are telling bundler to use that specific version. bundler install will install that version and set it in the gemfile.lock file. Once that is done it's safe to remove the version causing all your problems.

Bob

Enrique Moreira

unread,
Aug 9, 2011, 9:40:38 AM8/9/11
to hobo...@googlegroups.com
Good follow the instructions:

$ bundle install
Fetching source index for http://rubygems.org/
You have requested:
  will_paginate = 3.0.pre2

The bundle currently has will_paginate locked at 3.0.pre4.
Try running `bundle update will_paginate`
$ bundle update will_paginate
Fetching source index for http://rubygems.org/
.
Installing will_paginate (3.0.pre2) 
.
$ gem uninstall will_paginate
Select gem to uninstall:
 1. will_paginate-3.0.pre2
 2. will_paginate-3.0.pre4
 3. All versions
> 2

run mi app normally
 miapp$ rails s

Thas Ok! its Works



Date: Mon, 8 Aug 2011 20:34:15 -0700
From: bsl...@gmail.com
To: hobo...@googlegroups.com
Subject: [Hobo Users] Re: `@active_record/relation' is not allowed as an instance variable name
--
You received this message because you are subscribed to the Google Groups "Hobo Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hobousers/-/u1TA5fCoNWcJ.
To post to this group, send email to hobo...@googlegroups.com.
To unsubscribe from this group, send email to hobousers+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.

Jaman

unread,
Aug 9, 2011, 2:19:53 PM8/9/11
to hobo...@googlegroups.com
I tried several times but was still receiving errors. As a last resort I imploded rvm and started over.

works now :)

Thanks

Bob Sleys

unread,
Aug 10, 2011, 7:40:28 AM8/10/11
to hobo...@googlegroups.com
Glad you got it working. 
Reply all
Reply to author
Forward
0 new messages