11175
(-- --)
February 4, 2008, 6:32pm
1
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:
class GreetingController < ApplicationController
def greeting
end
end
Then put in my \app\views\greeting.rhtml page:
<html>
<head>
<title>Greeting Page</title>
</head>
<body>
<h1>Hello, this is my Greeting Page</h1>
</body>
</html>
After starting the project web app. in Mongrel and connecting here:
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!
11175
(-- --)
February 4, 2008, 7:22pm
2
(cont.)
I am using mySQL and have configured the database.yml file to have all
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
Aaron5
(Aaron)
February 4, 2008, 8:53pm
3
When you created the project, a file named "application.rb" should
have been created in app/controllers. This file defines the
ApplicationController class.
Aaron
11175
(-- --)
February 4, 2008, 9:20pm
4
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