Forum: Ruby on Rails Expected ... to define (rails version 1.2.2)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Steven A. (Guest)
on 2007-06-04 08:40
Hi, I'm having a mysterious problem that occurs when I'm using Rails
1.2.2.  My app works fine when the environment.rb file reads:

RAILS_GEM_VERSION = '1.1.6'

When I change this to:

RAILS_GEM_VERSION = '1.2.2'

and try to load http://<mydevhost>:3000/srs/, I get the following
traceback in the developer log:

Expected
/Users/thoth/Source/taskmaster/public/../config/../app/controllers/srs_controller.rb
to define SrsController
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:249:in
`load_missing_constant'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:452:in
`const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:464:in
`const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/inflector.rb:250:in
`constantize'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/core_ext/string/inflections.rb:148:in
`constantize'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/routing.rb:1284:in
`recognize'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:40:in
`dispatch'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/fcgi_handler.rb:168:in
`process_request'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/fcgi_handler.rb:143:in
`process_each_request!'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/fcgi_handler.rb:109:in
`with_signal_handler'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/fcgi_handler.rb:142:in
`process_each_request!'
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:612:in `each_cgi'
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:609:in `each'
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:609:in `each_cgi'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/fcgi_handler.rb:141:in
`process_each_request!'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/fcgi_handler.rb:55:in
`process!'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/fcgi_handler.rb:25:in
`process!'
/Users/thoth/Source/taskmaster/public/dispatch.fcgi:24

This is on Mac OS X 10.4.9, ruby 1.8.5, rails 1.2.2.  Anyone have any
idea why this would work fine when configured to use Rails 1.1.6, but
not 1.2.2?  Note that this project was originally generated by 1.1.6.
I'd like to upgrade it to 1.2.2.

steven
Keynan P. (Guest)
on 2007-06-04 08:49
the upgrade shouldn't have caused this. It sounds like the file

srs_controller.rb

does not contain

class SrsController
Keynan P. (Guest)
on 2007-06-04 08:51
Presumable this file exists but the class does not
if this is not immediately apparent could you post the contents of that
file?
Steven A. (Guest)
on 2007-06-04 09:01
Keynan P. wrote:
> Presumable this file exists but the class does not
> if this is not immediately apparent could you post the contents of that
> file?

It's a very large file, but here is an abbreviated listing:

class SrsController < ApplicationController
    layout "main"

    # GETs should be safe (see
http://www.w3.org/2001/tag/doc/whenToUseGet.html)
    verify :method => :post, :only => [ :destroy, :create, :update ],
           :redirect_to => { :action => :list }

    [numerous methods omitted]
end

[a handful of other classes defined below this]

Also, it seems strange that it would work fine when
RAILS_GEM_VERSION=1.1.6.  To me, this makes it unlikely that the problem
is syntax errors or simple omission of class definitions, but perhaps
Rails 1.2.2 is looking in the wrong directory or something of that
nature?  (Yet that doesn't make sense either, because when I vi
/Users/thoth/Source/taskmaster/public/../config/../app/controllers/srs_controller.rb,
the file exists and it defines SrsController as above.  I performed an
MD5 checksum on the path above and the more conventional path to
srs_controller.rb just to make sure they're the same, and indeed they
are.)

steven
This topic is locked and can not be replied to.