Forum: Ruby on Rails Controller not defined?

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.
Eduardo Y. (Guest)
on 2007-02-21 23:23
(Received via mailing list)
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
Deepak Vohra (Guest)
on 2007-02-22 01:14
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.
Eduardo Y. (Guest)
on 2007-02-22 10:31
(Received via mailing list)
> 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?
Eduardo Y. (Guest)
on 2007-02-22 10:49
(Received via mailing list)
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?
Eduardo Y. (Guest)
on 2007-02-22 11:01
(Received via mailing list)
> ./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?
This topic is locked and can not be replied to.