# Expected ... to define (rails version 1.2.2)

**URL:** <https://www.ruby-forum.com/t/expected-to-define-rails-version-1-2-2/105873>\
**Category:** Rails\
**Created:** [June 4, 2007, 6:40am UTC](https://www.ruby-forum.com/t/expected-to-define-rails-version-1-2-2/105873 "2007-06-04T06:40:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![steven290](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@steven290](https://www.ruby-forum.com/u/steven290)\
**Post date:** [June 4, 2007, 6:40am UTC](https://www.ruby-forum.com/t/expected-to-define-rails-version-1-2-2/105873/1 "2007-06-04T06:40:58Z")

</div>

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://: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

---

<div class="post-metadata">

**Author:** ![steven290](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@steven290](https://www.ruby-forum.com/u/steven290)\
**Post date:** [June 4, 2007, 6:49am UTC](https://www.ruby-forum.com/t/expected-to-define-rails-version-1-2-2/105873/2 "2007-06-04T06:49:32Z")

</div>

the upgrade shouldn’t have caused this. It sounds like the file

srs\_controller.rb

does not contain

class SrsController

---

<div class="post-metadata">

**Author:** ![steven290](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@steven290](https://www.ruby-forum.com/u/steven290)\
**Post date:** [June 4, 2007, 6:51am UTC](https://www.ruby-forum.com/t/expected-to-define-rails-version-1-2-2/105873/3 "2007-06-04T06:51:16Z")

</div>

Presumable this file exists but the class does not  
if this is not immediately apparent could you post the contents of that  
file?

---

<div class="post-metadata">

**Author:** ![steven290](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@steven290](https://www.ruby-forum.com/u/steven290)\
**Post date:** [June 4, 2007, 7:01am UTC](https://www.ruby-forum.com/t/expected-to-define-rails-version-1-2-2/105873/4 "2007-06-04T07:01:08Z")

</div>

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 

```

[URIs, Addressability, and the use of HTTP GET and POST](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
