Controller not defined?


#1

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:inconst_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:inconstantize’
/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:inrecognize’
/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:inhandle_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:inservice’
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:ineach’
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:instart’
/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:indispatch’
/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:inrequire’
/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:innew_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:inrequire__’
/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:inrequire’
/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:inrequire’
script/server:3


#2

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:inconst_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.


#3

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

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?


#4

./script/…/config/boot.rb:29: undefined method gem' for main:Object (NoMethodError) from script/server:2:inrequire’
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?


#5

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:inrequire’
from script/server:2

What’s going on now?