Expected ... to define


#1

Hi,

I have edge frozen on vendor, and getting these errors logged:

Expected …/config/…/app/controllers/store_controller.rb to define
StoreController
…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:177:in
load_missing_constant' ../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:275:inconst_missing’
…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:282:in
const_missing' ../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/inflector.rb:162:inconstantize’
…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/core_ext/string/inflections.rb:148:in
constantize' ../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1035:inrecognize’
…/config/…/vendor/rails/railties/lib/dispatcher.rb:40:in dispatch' ../config/../vendor/rails/railties/lib/fcgi_handler.rb:150:inprocess_request’
…/config/…/vendor/rails/railties/lib/fcgi_handler.rb:54:in process!' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:ineach_cgi’
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in each_cgi' ../config/../vendor/rails/railties/lib/fcgi_handler.rb:53:inprocess!’
…/config/…/vendor/rails/railties/lib/fcgi_handler.rb:23:in `process!’
dispatch.fcgi:24

Has anyone seen this? Any hints to fix it?

Thank you.


#2

Juan wrote:

Hi,

I have edge frozen on vendor, and getting these errors logged:

Expected …/config/…/app/controllers/store_controller.rb to define
StoreController
…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:177:in
load_missing_constant' ../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:275:inconst_missing’
…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:282:in
const_missing' ../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/inflector.rb:162:inconstantize’
…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/core_ext/string/inflections.rb:148:in
constantize' ../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1035:inrecognize’
…/config/…/vendor/rails/railties/lib/dispatcher.rb:40:in dispatch' ../config/../vendor/rails/railties/lib/fcgi_handler.rb:150:inprocess_request’
…/config/…/vendor/rails/railties/lib/fcgi_handler.rb:54:in process!' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:ineach_cgi’
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in each_cgi' ../config/../vendor/rails/railties/lib/fcgi_handler.rb:53:inprocess!’
…/config/…/vendor/rails/railties/lib/fcgi_handler.rb:23:in `process!’
dispatch.fcgi:24

Has anyone seen this? Any hints to fix it?

Thank you.

Did anyone ever figure out what this was about? I’m getting the same
error and I’m not entirely sure what’s wrong. It’s occurring on a
model, and the problem goes away when I comment out the Acts_As_Ferret
plugin.

James H


#3

James H wrote:

Juan wrote:

Hi,

I have edge frozen on vendor, and getting these errors logged:

Expected …/config/…/app/controllers/store_controller.rb to define
StoreController
…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:177:in
load_missing_constant' ../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:275:inconst_missing’
…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/dependencies.rb:282:in
const_missing' ../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/inflector.rb:162:inconstantize’
…/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/core_ext/string/inflections.rb:148:in
constantize' ../config/../vendor/rails/actionpack/lib/action_controller/routing.rb:1035:inrecognize’
…/config/…/vendor/rails/railties/lib/dispatcher.rb:40:in dispatch' ../config/../vendor/rails/railties/lib/fcgi_handler.rb:150:inprocess_request’
…/config/…/vendor/rails/railties/lib/fcgi_handler.rb:54:in process!' /usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:ineach_cgi’
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in each_cgi' ../config/../vendor/rails/railties/lib/fcgi_handler.rb:53:inprocess!’
…/config/…/vendor/rails/railties/lib/fcgi_handler.rb:23:in `process!’
dispatch.fcgi:24

Has anyone seen this? Any hints to fix it?

Thank you.

Did anyone ever figure out what this was about? I’m getting the same
error and I’m not entirely sure what’s wrong. It’s occurring on a
model, and the problem goes away when I comment out the Acts_As_Ferret
plugin.

James H

I too am now seeing this problem with 1.2.3 and one of my model classes.
The problem is intermittent for me and it seems I can get rid of it by
bouncing my mongrels when it happens.

Will post again if I figure out what it is.

-Michael


#4

so there is noone that solved this? are you still working on a solution
or have been successful?


#5

There’s an open ticket but we can’t get any closure on it. I actually
see
this in a controller on a production 1.2.3 app occasionally. It’s quite
irritating.

See here for a good start:

http://blog.teksol.info/articles/2007/03/09/expected-x-to-define-y-error

Perhaps if the related ticket at http://dev.rubyonrails.org/ticket/7452
gets
some more attention, this bug will too. The problem is that we don’t
get
much attention to bugs from the core unless we can show how to reproduce
the
problem, which I totally understand… but this one’s a bit difficult
to
track down or reproduce on demand.

In my case, I bounce the system and I’m good, but apps stopping really
stink.


#6

I’m getting this error intermittently as well, but only on production
running ferret with DRB.

The index crashes and then i get “X was expected to define Y”.

Killing ferret and then restarting mongrel gets things running properly
again, but it’s a major pain.

Has anyone found a real solution to this - or is ferret not ready for a
high-traffic production env?

Cheers ,

Bryan

Brian H. wrote:

There’s an open ticket but we can’t get any closure on it. I actually
see
this in a controller on a production 1.2.3 app occasionally. It’s quite
irritating.

See here for a good start:

http://blog.teksol.info/articles/2007/03/09/expected-x-to-define-y-error

Perhaps if the related ticket at http://dev.rubyonrails.org/ticket/7452
gets
some more attention, this bug will too. The problem is that we don’t
get
much attention to bugs from the core unless we can show how to reproduce
the
problem, which I totally understand… but this one’s a bit difficult
to
track down or reproduce on demand.

In my case, I bounce the system and I’m good, but apps stopping really
stink.


#7

Juan wrote:

Hi,

I have edge frozen on vendor, and getting these errors logged:

Expected …/config/…/app/controllers/store_controller.rb to define
StoreController …
Has anyone seen this? Any hints to fix it?

I had the same error on my production server. It has something to do
with index files. I changed RAILS_ROOT/index directory permissions to
something writable by web server and it worked.


#8

On 26 Mar 2008, at 01:04, Harry S. wrote:

chmod -R 777 index but it did not solve my problem.
It’s a general ‘Something went bad when trying to load
store_controller.rb’ (and rather unhelpful).
It can be a syntax error in store_controller, a require which threw a
LoadError etc…

Fred


#9

I’ve experienced the same, but making index/ writable by web server and
restarting ferret solved the issue. It’s definitely (in my case) related
to acts_as_ferret.


#10

Reza Esmily wrote:

Juan wrote:

Hi,

I have edge frozen on vendor, and getting these errors logged:

Expected …/config/…/app/controllers/store_controller.rb to define
StoreController …
Has anyone seen this? Any hints to fix it?

I had the same error on my production server. It has something to do
with index files. I changed RAILS_ROOT/index directory permissions to
something writable by web server and it worked.

Hi
I got into the same troubles with ferret. But I don’t manage to get it
working.
What do you mean exactly by “something writable by web server” ? I tried
a
chmod -R 777 index but it did not solve my problem.

H


#11

François Montel wrote:

I’ve experienced the same, but making index/ writable by web server and
restarting ferret solved the issue. It’s definitely (in my case) related
to acts_as_ferret.

Oh, and besides restarting ferret, you’ll probably have to restart
mongrel.