# Hello World: uninitialized constant ApplicationController

**URL:** <https://discuss.rubyonrails.org/t/hello-world-uninitialized-constant-applicationcontroller/24328>\
**Category:** rubyonrails-talk\
**Created:** [February 4, 2008, 6:32pm UTC](https://discuss.rubyonrails.org/t/hello-world-uninitialized-constant-applicationcontroller/24328 "2008-02-04T18:32:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [February 4, 2008, 6:32pm UTC](https://discuss.rubyonrails.org/t/hello-world-uninitialized-constant-applicationcontroller/24328/1 "2008-02-04T18:32:28Z")

</div>

Have the Wrox guide, but still having problems getting my hello world to run (very frustrating! 😉 Installed latest InstantRails package for Windows (XP). Thank you so much for helping!!

Dirk

After creating the project directories, I created my \app\controllers\greeting\_controller.rb file:

&nbsp;&nbsp;class GreetingController \< ApplicationController &nbsp;&nbsp;&nbsp;&nbsp;def greeting &nbsp;&nbsp;&nbsp;&nbsp;end &nbsp;&nbsp;end

Then put in my \app\views\greeting.rhtml page:

&nbsp;&nbsp;\<html\> &nbsp;&nbsp;\<head\> &nbsp;&nbsp;\<title\>Greeting Page\</title\> &nbsp;&nbsp;\</head\>

&nbsp;&nbsp;\<body\> &nbsp;&nbsp;\<h1\>Hello, this is my Greeting Page\</h1\> &nbsp;&nbsp;\</body\> &nbsp;&nbsp;\</html\>

After starting the project web app. in Mongrel and connecting here: [http://localhost:3000/greeting/greeting](http://localhost:3000/greeting/greeting)

I get the following error:

NameError in GreetingController#greeting

uninitialized constant ApplicationController

How is this base class initialized? I must be leaving something very basic out, Thanks for helping!

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [February 4, 2008, 7:22pm UTC](https://discuss.rubyonrails.org/t/hello-world-uninitialized-constant-applicationcontroller/24328/2 "2008-02-04T19:22:10Z")

</div>

(cont.)

I am using mySQL and have configured the database.yml file to have all &nbsp;&nbsp;&nbsp;adapter: mysql

Also, here is the full trace of the error message above: C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:266:in `load_missing_constant' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const\_missing' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:465:in `const_missing' app/controllers/greeting_controller.rb:1 C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in `load\_without\_new\_constant\_marking' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:203:in `load_file' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in `new\_constants\_in' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:202:in `load_file' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:94:in `require\_or\_load' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:248:in `load_missing_constant' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in `const\_missing' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/dependencies.rb:465:in `const_missing' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/inflector.rb:257:in `constantize' C:/ruby/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/core\_ext/string/inflections.rb:148:in `constantize' C:/ruby/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1426:in `recognize' C:/ruby/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:170:in `handle_request' C:/ruby/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch' C:/ruby/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action\_controller/dispatcher.rb:126:in `dispatch_cgi' C:/ruby/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/rails.rb:76:in `process' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/rails.rb:74:in `synchronize' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/rails.rb:74:in `process' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:159:in `process\_client' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:158:in `each' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:158:in `process\_client' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in `run' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in `initialize' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in `new' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:285:in `run' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:268:in `initialize' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:268:in `new' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel.rb:268:in `run' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/configurator.rb:282:in `run' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/configurator.rb:281:in `each' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/configurator.rb:281:in `run' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/mongrel\_rails:128:in `run' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/lib/mongrel/command.rb:212:in `run' C:/ruby/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/mongrel\_rails:281 C:/ruby/ruby/bin/mongrel\_rails:19:in `load' C:/ruby/ruby/bin/mongrel\_rails:19

---

<div class="post-metadata">

**Author:** ![Aaron5](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Aaron5](https://discuss.rubyonrails.org/u/Aaron5)\
**Post date:** [February 4, 2008, 8:53pm UTC](https://discuss.rubyonrails.org/t/hello-world-uninitialized-constant-applicationcontroller/24328/3 "2008-02-04T20:53:30Z")

</div>

When you created the project, a file named "application.rb" should have been created in app/controllers. This file defines the ApplicationController class.

Aaron

---

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [February 4, 2008, 9:20pm UTC](https://discuss.rubyonrails.org/t/hello-world-uninitialized-constant-applicationcontroller/24328/4 "2008-02-04T21:20:35Z")

</div>

Aaron wrote:

> When you created the project, a file named "application.rb" should have been created in app/controllers. This file defines the ApplicationController class.
> 
> Aaron

Thank you so much! Yes, a silly error, I have just confirmed and it now works. It's not yet so well documented in Wrox "Beginning Ruby on Rails"

Thank you again, Dirk
