# Controller not defined?

**URL:** <https://www.ruby-forum.com/t/controller-not-defined/86383>\
**Category:** Rails\
**Created:** [February 21, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/controller-not-defined/86383 "2007-02-21T22:23:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eyp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e274bd/32.png) [@eyp](https://www.ruby-forum.com/u/eyp)\
**Post date:** [February 21, 2007, 10:23pm UTC](https://www.ruby-forum.com/t/controller-not-defined/86383/1 "2007-02-21T22:23:35Z")

</div>

Using Rails 1.2.2

What does it mean this error? What did I miss?

Expected script/…/config/…/app/controllers/backups\_controller.rb to  
define BackupsController  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/  
dependencies.rb:249:in `load_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ dependencies.rb:452:in`const\_missing’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/  
dependencies.rb:464:in `const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ inflector.rb:250:in`constantize’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/  
core\_ext/string/inflections.rb:148:in `constantize' /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/ routing.rb:1284:in`recognize’  
/usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/dispatcher.rb:40:in  
`dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:113:in`handle\_dispatch’  
/usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick\_server.rb:79:in  
`service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in`service’  
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:173:in`start\_thread’  
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/lib/ruby/1.8/webrick/server.rb:162:in`start\_thread’  
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in`each’  
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:23:in`start’  
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/webrick_server.rb:63:in`dispatch’  
/usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/servers/  
webrick.rb:59  
/usr/lib/site\_ruby/1.8/rubygems/custom\_require.rb:21:in `require__' /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in`require’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/  
dependencies.rb:495:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ dependencies.rb:342:in`new\_constants\_in’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/  
dependencies.rb:495:in `require' /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/commands/server.rb:39 /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in`require\_\_’  
/usr/lib/site\_ruby/1.8/rubygems/custom\_require.rb:21:in `require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ dependencies.rb:495:in`require’  
/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/  
dependencies.rb:342:in `new_constants_in' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ dependencies.rb:495:in`require’  
script/server:3

---

<div class="post-metadata">

**Author:** ![eyp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e274bd/32.png) [@eyp](https://www.ruby-forum.com/u/eyp)\
**Post date:** [February 22, 2007, 12:14am UTC](https://www.ruby-forum.com/t/controller-not-defined/86383/2 "2007-02-22T00:14:46Z")

</div>

Eduardo YÃ¡Ã±ez Parareda wrote:

> Using Rails 1.2.2
> 
> What does it mean this error? What did I miss?
> 
> Expected script/…/config/…/app/controllers/backups\_controller.rb to  
> define BackupsController  
> /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/  
> dependencies.rb:249:in `load_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/ dependencies.rb:452:in`const\_missing’  
> /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_support/  
> dependencies.rb:464:in `const\_missing’

Expected script/…/config/…/app/controllers/backups\_controller.rb to  
define BackupsController

The backups\_controller.rb script should define BackupsController class.

---

<div class="post-metadata">

**Author:** ![eyp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e274bd/32.png) [@eyp](https://www.ruby-forum.com/u/eyp)\
**Post date:** [February 22, 2007, 9:31am UTC](https://www.ruby-forum.com/t/controller-not-defined/86383/3 "2007-02-22T09:31:52Z")

</div>

> Expected script/…/config/…/app/controllers/backups\_controller.rb to  
> define BackupsController
> 
> The backups\_controller.rb script should define BackupsController class.

I thought so, but this is my app/controller/backups\_controller.rb

class BackupsController \< ApplicationController  
before\_filter :check\_authentication

Page\_Size = 15

def index  
list  
render :action =\> ‘list’  
end

# 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 }

def list  
@backup\_pages, @backups = paginate :backups, :order =\> “bkcode  
DESC”, :per\_page =\> Page\_Size  
end

def show  
@backup = Backup.find

bla, bla, bla…

end

Before I got this error, I was using Edge-Rails, then I updated to  
Rails 1.2.2 then nothing works now. Any tips?

---

<div class="post-metadata">

**Author:** ![eyp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e274bd/32.png) [@eyp](https://www.ruby-forum.com/u/eyp)\
**Post date:** [February 22, 2007, 10:01am UTC](https://www.ruby-forum.com/t/controller-not-defined/86383/4 "2007-02-22T10:01:54Z")

</div>

> ./script/…/config/boot.rb:29: undefined method `gem' for main:Object (NoMethodError) from script/server:2:in`require’  
> from script/server:2

I’m sorry , I’ve updated gems and server go up ok, but I still have  
the problem with the controller… it says it isn’t defined but  
the file it’s in… Something new in 1.2.2 that I have to have in  
count?

---

<div class="post-metadata">

**Author:** ![eyp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/e274bd/32.png) [@eyp](https://www.ruby-forum.com/u/eyp)\
**Post date:** [February 22, 2007, 9:49am UTC](https://www.ruby-forum.com/t/controller-not-defined/86383/5 "2007-02-22T09:49:53Z")

</div>

I thought I forgot to update the project with rake rails:update  
(in /home/eyp/Desarrollo/ruby/repository/rtapelib)  
install -c -m 0755 /usr/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/  
tasks/…/…/bin/process/inspector script/process/inspector

But when I run the server now I get this error:

ruby script/server

./script/…/config/boot.rb:29: undefined method `gem' for main:Object (NoMethodError) from script/server:2:in`require’  
from script/server:2

What’s going on now?
