First App- Error 500

I've created a simple hello world app that doesnt appear to serve up
the view greeting.rhtml. :<
Any ideas ?

The error message is from development.log is...
# Logfile created on Tue Aug 18 16:49:55 -0400 2009/!\ FAILSAFE /!\
Tue Aug 18 16:50:34 -0400 2009
  Status: 500 Internal Server Error
  unknown error

PS . It does show the default web page ok at http://localhost:3000
just not the app

Here is my controller in c:\ruby\hello\app\controllers
\app_controller.rb
.....
class AppController < ApplicationController

  def greeting
  end

end

Here is my view in c:\ruby\hello\app\views\app\greeting.rhtml

<html>
    <head>
        Ruby on Rails
    </head>
    <body>
        Yes its working!
    </body>
</html>

Here is the URL that I'm trying to access it

http://localhost:3000/App/greeting

PS . It does show the default web page ok athttp://localhost:3000
just not the app

It doesn't show the app because you don't actually have one.

You should read what you see at http://localhost:3000. Specifically,
steps 1, 2, and 3 in the main panel give you some obvious tips on
what's next.

If these tips are too vague you can find more detailed information on
the right panel. Under "Browse the Documentation" follow "Rails
Guides" to "Getting Started with Rails".

You might also consider picking up a book and working through an
example. Pay careful attention here, however, to the versions of Ruby
and Rails (and any gems and plugins) used in the book.

Happy tRails

I followed step by step the instructions for the first application in
the Begining Ruby for Rails book
and checked the online documentation before even posting.

Do you have any suggestions as shown I have a controller and a view
and an application defined but
its not finding it or giving me the error message posted.....any
ideas ?

Thanks!

I followed step by step the instructions for the first application in
the Begining Ruby for Rails book
and checked the online documentation before even posting.

Do you have any suggestions as shown I have a controller and a view
and an application defined but
its not finding it or giving me the error message posted.....any
ideas ?

Look at the log file in log/development.log It's probably something
like a bad database setup or similar.

fred

I did look at the log file and even posted the error message in the
very first post..

see...below...Any ideas ?

The error message is from development.log is...
# Logfile created on Tue Aug 18 16:49:55 -0400 2009/!\ FAILSAFE /!\
Tue Aug 18 16:50:34 -0400 2009
  Status: 500 Internal Server Error
  unknown error

  Status: 500 Internal Server Error
  unknown error

PS . It does show the default web page ok at http://localhost:3000
just not the app

Here is my controller in c:\ruby\hello\app\controllers
\app_controller.rb
.....
class AppController < ApplicationController

  def greeting
  end

end

Here is my view in c:\ruby\hello\app\views\app\greeting.rhtml

<html>
    <head>
        Ruby on Rails
    </head>
    <body>
        Yes its working!
    </body>
</html>

Here is the URL that I'm trying to access it

http://localhost:3000/App/greeting

Your problem is a missmatch between the controller name and the view
directory name.
If you're going to use application_controller.rb then c:\ruby\hello\app
\views\app\greeting.rhtml should be c:\ruby\hello\app\views
\application\greeting.rhtml.

You can use scaffold to help get more familiar with what goes where.
Try this:

script/generate scaffold User name:string profile:text

Now check for new files in app\controllers, app\views, app\models, and
db\migrations

Then run:
rake db:migrate
And restart your webserver and browse:
http://localhost:3000/users

Rick

I did look at the log file and even posted the error message in the
very first post..

see...below...Any ideas ?

Oops, didn't spot that. You may get a more verbose error if you try to
run

ruby script/console

Fred

Using rails 2.3.3

I've put greeting.rhtml in both

app\views\app

and

app\views\application

SAME result....Any other ideas ?

I've tried starting it in console mode but it just says Load Develope
Env >>

I'm trying to stay positive about Rails but am a little discouraged
that
I can get my first controller/view working :<

Using rails 2.3.3

I've put greeting.rhtml in both

app\views\app

and

app\views\application

SAME result....Any other ideas ?

As I said before, it should be greeting.html.erb , not
greeting.rhtml . Why are you using .rhtml ? That hasn't been correct
for a long time, and it makes me think that you may be following a
tutorial for an older version.

I've tried starting it in console mode but it just says Load Develope
Env >>

Yes, that's what it should say. What's the problem?

I'm trying to stay positive about Rails but am a little discouraged
that
I can get my first controller/view working :<

What documentation have you been using?

Best,

I've changed the view name to greeting.html.erb as suggested
but SAME results..

I was jusing the book Beginging Ruby on Rails and
looking at the online documentation.

Any other suggestions ?

ok, so just to be complete, what do you get when you type:

rake routes

C:\Ruby\hello>rake routes
(in C:/Ruby/hello)
  /:controller/:action/:id
  /:controller/:action/:id(.:format)

When your http://localhost:3000 comes up, what do you see if you
follow the link "About_your_application's_environment"?

I get:

Ruby version 1.8.7 (powerpc-darwin9.7.0)
RubyGems version 1.3.4
Rack version 1.0
Rails version 2.3.3
Active Record version 2.3.3
Action Pack version 2.3.3
Active Resource version 2.3.3
Action Mailer version 2.3.3
Active Support version 2.3.3
Application root /Users/rick/hello
Environment development
Database adapter sqlite3
Database schema version 0

Also, using your app_controller.rb and views/app/greeting.rhtml in
this environment does the right thing in response to http://localhost:3000/app/greeting.

When I click on About Environment , I get

We're sorry, but something went wrong

The log says
!\ FAILSAFE /!\ Fri Aug 21 08:06:58 -0400 2009
  Status: 500- Internal Server Error
  unknown error

Unfortunately its not telling much more which is a little frustrating.
I even downloaded ruby again , reinstalled rails . Then as before
it failed initially because of sqlite3 not being there which I
installed
but then I still get the same error message...

Any ideas ?

If I do a gem list , I get

actionmailer (2.3.3)
actionpack (2.3.3)
activerecord (2.3.3)
activeresource (2.3.3)
activesupport (2.3.3)
fxri (0.3.6)
fxruby (1.6.16)
hpricot (0.6.164)
log4r (1.0.5)
ptools (1.1.6)
rack (1.0.0)
rails (2.3.3)
rake (0.8.7, 0.8.1)
ruby-opengl (0.60.0)
sqlite-ruby (2.2.3)
sqlite3-ruby (1.2.1)
test-unit (2.0.1)
win32-api (1.2.1, 1.2.0)
win32-clipboard (0.4.4)
win32-dir (0.3.2)
win32-eventlog (0.5.0)
win32-file (0.5.5)
win32-file-stat (1.3.1)
win32-process (0.5.9)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.4)
windows-pr (0.9.3)

mgpowers, do one thing. Create a new rails application mgp

rails mgp
cd mgp
ruby script/create controller myfirst greeting

in myfirst controller greeting action put

  def greeting
    @n = "I am mgp"
  end

in app\views\myfirst\greeting.html.erb put this

<b>Yes its working! <%=@n%></b>

remove your \public\index.html

Now start server -- ruby script/server (you should be inside your mgp
directory)

goto http://localhost:3000/myfirst/greeting

you should get appropriate results.

let me know how it goes.

http://www.classifiedscript.in
Free Craigslist Classified Script

http://www.buildingwebapps.com/learningrails

Start here with your first app. Download and follow all the screencasts
- they are free.

Thanks for all the support....I am really trying to hang in there
especially since there appears to be
many good things with Rails but it is hard not knowing exactly why its
failing.....Here is what happened
when I tired creating the contollter...

C:\Ruby\mgp>ruby script/create controller myfirst greeting
ruby: No such file or directory -- script/create (LoadError)

C:\Ruby\mgp>ruby script\create controller myfirst greeting
ruby: No such file or directory -- script/create (LoadError)

C:\Ruby\mgp>dir
Volume in drive C has no label.
Volume Serial Number is 0C3F-B4D3

Directory of C:\Ruby\mgp

08/21/2009 10:13 AM <DIR> .
08/21/2009 10:13 AM <DIR> ..
08/21/2009 10:13 AM <DIR> app
08/21/2009 10:13 AM <DIR> config
08/21/2009 10:13 AM <DIR> db
08/21/2009 10:13 AM <DIR> doc
08/21/2009 10:13 AM <DIR> lib
08/21/2009 10:13 AM <DIR> log
08/21/2009 10:13 AM <DIR> public
08/21/2009 10:13 AM 307 Rakefile

Thanks for all the support....I am really trying to hang in there
especially since there appears to be
many good things with Rails but it is hard not knowing exactly why its
failing.....Here is what happened
when I tired creating the contollter...

C:\Ruby\mgp>ruby script/create controller myfirst greeting
ruby: No such file or directory -- script/create (LoadError)

I think that was a typo in Rails List's post, it should have been
ruby script/generate controller myfirst greeting

Colin

ok...do all the steps mentioned I still get the same error message....
Why doesnt Webrick tell us more about what exactly is wrong !?!?!!?

/!\ FAILSAFE /!\ Fri Aug 21 12:56:58 -0400 2009
  Status: 500 Internal Server Error
  unknown error
    C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `initialize'
    C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `dlopen'
    C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `dlload'
    C:/Ruby/lib/ruby/1.8/dl/import.rb:27:in `each'
    C:/Ruby/lib/ruby/1.8/dl/import.rb:27:in `dlload'
    C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/
sqlite3/driver/dl/api.rb:63
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
active_support/dependencies.rb:156:in `require'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
active_support/dependencies.rb:521:in `new_constants_in'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
active_support/dependencies.rb:156:in `require'
    C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/
sqlite3/driver/dl/driver.rb:33
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
active_support/dependencies.rb:156:in `require'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
active_support/dependencies.rb:521:in `new_constants_in'
    C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
active_support/dependencies.rb:156:in `require'
    C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/
sqlite3/database.rb:643:in `load_driver'
    C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/
sqlite3/database.rb:641:in `each'
    C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/
sqlite3/database.rb:641:in `load_driver'
    C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1-x86-mswin32/lib/
sqlite3/database.rb:107:in `initialize'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/sqlite3_adapter.rb:13:in `new'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/sqlite3_adapter.rb:13:in
`sqlite3_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:223:in
`send'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
    C:/Ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
123:in `retrieve_connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_specification.rb:
115:in `connection'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/query_cache.rb:9:in `cache'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/query_cache.rb:28:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/
active_record/connection_adapters/abstract/connection_pool.rb:361:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/head.rb:9:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
methodoverride.rb:24:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/
action_controller/params_parser.rb:15:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/
action_controller/session/cookie_store.rb:93:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/
action_controller/reloader.rb:29:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/
action_controller/failsafe.rb:26:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in
`synchronize'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/
action_controller/dispatcher.rb:106:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/rails/rack/
static.rb:31:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:46:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in
`each'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in
`call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/rails/rack/
log_tailer.rb:17:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/
content_length.rb:13:in `call'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/
webrick.rb:46:in `service'
    C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    C:/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
    C:/Ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
    C:/Ruby/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/
webrick.rb:13:in `run'
    C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/commands/server.rb:
111
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
    C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
    script/server:3

yes...but I still got the same result when I ran the application
myfirst ....
any way to get Ruby , rails to tell us what it really doesnt like vs.
unknown error