PLEASE! Need help with my RoR app

Hi there, this is my first time setting up a ruby on rails container, ran script/generate controller main index, its working fine, but then i ran script/generate scaffold thoughts title:string body:text (just to test it), then i ran rake db:migrate and everything is still ok.

but then i goto myapp.com/thoughts and t displays the following message.

We're sorry, but something went wrong.

We've been notified about this issue and we'll take a look at it shortly.

PLEASE NEED HELP, i've been 2 freeking weeks, and it's driving me nuts to the point that suicide seems to be the only solution to my problem

thanks

Hi there, this is my first time setting up a ruby on rails container, ran script/generate controller main index, its working fine, but then i ran script/generate scaffold thoughts title:string body:text (just to test it), then i ran rake db:migrate and everything is still ok.

but then i goto myapp.com/thoughts and t displays the following message.

We're sorry, but something went wrong.

We've been notified about this issue and we'll take a look at it shortly.

The real error message should be in your log files somewhere (in your app's log folder)

PLEASE NEED HELP, i've been 2 freeking weeks, and it's driving me nuts to the point that suicide seems to be the only solution to my problem

I doubt that would actually help.

Fred

this is weird because i dont have this kind of problems in my local pc, Here's what the error says:

ActionView::TemplateError (undefined method `to_sym' for nil:NilClass) on line #15 of thoughts/index.html.erb: 12: <td><%=h thoughts.title %></td> 13: <td><%=h thoughts.body %></td> 14: </tr> 15: <% end %> 16: </table> 17: 18: <br />

    /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/routing/route.rb:145:in `extra_keys'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/routing/route.rb:145:in `map'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/routing/route.rb:145:in `extra_keys'     generated code (/home/25926/data/rubygems/gems/gems/ actionpack-2.1.0/lib/action_controller/routing/route.rb:45):3:in `generate'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/routing/route_set.rb:337:in `generate'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/url_rewriter.rb:131:in `rewrite_path'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/url_rewriter.rb:110:in `rewrite_url'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/url_rewriter.rb:88:in `rewrite'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/base.rb:621:in `url_for'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/helpers/url_helper.rb:71:in `send'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/helpers/url_helper.rb:71:in `url_for'     (eval):17:in `thoughts_path'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/polymorphic_routes.rb:101:in `send!'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/polymorphic_routes.rb:101:in `polymorphic_url'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/polymorphic_routes.rb:108:in `polymorphic_path'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/helpers/url_helper.rb:79:in `url_for'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/helpers/url_helper.rb:199:in `link_to'     app/views/thoughts/index.html.erb:15:in `_run_erb_47app47views47thoughts47index46html46erb'     app/views/thoughts/index.html.erb:10:in `each'     app/views/thoughts/index.html.erb:10:in `_run_erb_47app47views47thoughts47index46html46erb'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/base.rb:338:in `send'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/base.rb:338:in `execute'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/template_handlers/compilable.rb:29:in `send'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/template_handlers/compilable.rb:29:in `render'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/template.rb:35:in `render'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/template.rb:22:in `render_template'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_view/base.rb:245:in `render_file'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/base.rb:1108:in `render_for_file'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/base.rb:865:in `render_with_no_layout'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/base.rb:880:in `render_with_no_layout'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/layout.rb:251:in `render_without_benchmark'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/benchmarking.rb:51:in `render'     /home/25926/data/rubygems/gems/gems/activesupport-2.1.0/lib/ active_support/core_ext/benchmark.rb:8:in `realtime'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/benchmarking.rb:51:in `render'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:131:in `send'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:131:in `custom'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:160:in `call'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:160:in `respond'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:154:in `each'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:154:in `respond'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/mime_responds.rb:107:in `respond_to'     app/controllers/thoughts_controller.rb:7:in `index'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/base.rb:1162:in `send'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/base.rb:1162:in `perform_action_without_filters'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/filters.rb:580:in `call_filters'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/filters.rb:573:in `perform_action_without_benchmark'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'     /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/rescue.rb:201:in `perform_action_without_caching'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/caching/sql_cache.rb:13:in `perform_action'     /home/25926/data/rubygems/gems/gems/activerecord-2.1.0/lib/ active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'     /home/25926/data/rubygems/gems/gems/activerecord-2.1.0/lib/ active_record/query_cache.rb:8:in `cache'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/caching/sql_cache.rb:12:in `perform_action'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/base.rb:529:in `send'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/base.rb:529:in `process_without_filters'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/filters.rb:569:in `process_without_session_management_support'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/session_management.rb:130:in `process'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/base.rb:389:in `process'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:149:in `handle_request'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:107:in `dispatch'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:104:in `synchronize'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:104:in `dispatch'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:120:in `dispatch_cgi'     /home/25926/data/rubygems/gems/gems/actionpack-2.1.0/lib/ action_controller/dispatcher.rb:35:in `dispatch'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel/rails.rb:76:in `process'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel/rails.rb:74:in `synchronize'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel/rails.rb:74:in `process'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:159:in `process_client'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:158:in `each'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:158:in `process_client'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:285:in `run'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:285:in `initialize'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:285:in `new'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:285:in `run'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:268:in `initialize'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:268:in `new'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel.rb:268:in `run'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel/configurator.rb:282:in `run'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel/configurator.rb:281:in `each'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel/configurator.rb:281:in `run'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/bin/ mongrel_rails:128:in `run'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/lib/ mongrel/command.rb:212:in `run'     /home/25926/data/rubygems/gems/gems/mongrel-1.1.5-x86-linux/bin/ mongrel_rails:281

Rendering /home/25926/containers/rails/ets/public/500.html (500 Internal Server Error)

And the actual view has this code:

<h1>Listing thoughts</h1>

<table>   <tr>     <th>Title</th>     <th>Body</th>     <th>Thought date</th>   </tr>

<% for thoughts in @thoughts %>   <tr>     <td><%=h thoughts.title %></td>     <td><%=h thoughts.body %></td>   </tr> <% end %> </table>

<br />

<%= link_to 'New thoughts', new_thought_path %>

Thanks for replying my msn

looks like it's not liking your new_thought_path.

Fred

I'd also add that you're running in production mode. You should run in development mode while you are developing. That'll make life easier.

How you do that depends on what server software you're using. If you're using mongrel or webrick, use

script/server -edevelopment

or set your RAILS_ENV variable to development.

Yeah, i thought it was not liking my link, but that's very weird because that's the way it is in my local

"map.resources :thoughts" is what i have in my routes/rb, and as far as i know the map.resources should create the basics links. exacly like the way it is right now.

I'm using mongrel.

I switched to the development environment and it seems to works, BUT, when i submit data it gives me more problems, so i go back to myapp.com/thoughts, and the application displays thedata i ust submitted.

weird. i guess that the way i should keep working with it is in development mode and then read the logs to solve it, right?

I've seen this behaviour when I've found myself running in production mode without thinking - the production database (sqlite3 in my case) is empty and you get 500 errors - once the db schema is cloned to pruduction - using rake, I think... - you'll see results in production.

J