I have a perplexing situation. Naturally, it''s 3:30 in the morning and I should have been asleep two hours ago.... Note: MacOS X 10.4.2, patch from http://tech.rufy.com/entry/46 installed. 1) I generated a new rails app (I''m running 0.13.1.1935). Before I updated to that version tonight, I was having the same problem reported by Alex Castro on July 25. 2) I generated a scaffold (script/generate scaffold Topics). 3) I typed script/server. 4) I entered http://localhost:3000/topics/ into my browser. What I get is a completely BLANK page. 127.0.0.1 - - [28/Jul/2005:03:23:40 PDT] "GET /topics/ HTTP/1.1" 200 0 - -> /topics/ See? Zero bytes served. (and yes, scaffold named the controller topics; if it hadn''t, rails would have happily served an error message, leading to a non-zero byte count) No error messages in browser, either. The one difference between this and other rails stuff I''ve been working on is that it''s in postgres. I''m not a postgres expert, but I have got it running with -i and I can connect to the db with other apps that require that. Besides, wouldn''t it harf (with SOME text) if it couldn''t get through? In other news, a previously-working mysql app that didn''t use scaffolding is also now offering up blank pages. Any suggestions?
> I have a perplexing situation. Naturally, it''s 3:30 in the morning > and I should have been asleep two hours ago.... > > Note: MacOS X 10.4.2, patch from http://tech.rufy.com/entry/46 > installed. > > 1) I generated a new rails app (I''m running 0.13.1.1935). Before I > updated to that version tonight, I was having the same problem > reported by Alex Castro on July 25. > 2) I generated a scaffold (script/generate scaffold Topics). > 3) I typed script/server. > 4) I entered http://localhost:3000/topics/ into my browser. > > What I get is a completely BLANK page. > > 127.0.0.1 - - [28/Jul/2005:03:23:40 PDT] "GET /topics/ HTTP/1.1" 200 0 > - -> /topics/ > > See? Zero bytes served. > > (and yes, scaffold named the controller topics; if it hadn''t, rails > would have happily served an error message, leading to a non-zero > byte count) > > No error messages in browser, either. > > The one difference between this and other rails stuff I''ve been > working on is that it''s in postgres. > > I''m not a postgres expert, but I have got it running with -i and I > can connect to the db with other apps that require that. Besides, > wouldn''t it harf (with SOME text) if it couldn''t get through? > > In other news, a previously-working mysql app that didn''t use > scaffolding is also now offering up blank pages.Are you running beta gems? There was a glitch recently that kept stack traces from showing in webrick. It''s been fixed in SVN as far as I know, but I''m not sure how current the beta gems are. Until the fix trickles its way down to the beta gems, just keep an eye on your development error log. -- rick http://techno-weenie.net
Deirdre Saoirse Moen
2005-Jul-28 19:11 UTC
Re: New app, 1 scaffold, pages completely blank
On Jul 28, 2005, at 5:44 AM, Rick Olson wrote:> Are you running beta gems? There was a glitch recently that kept > stack traces from showing in webrick. It''s been fixed in SVN as far > as I know, but I''m not sure how current the beta gems are.I wouldn''t have thought I was, but when I looked at the command I did for the update, I was. Argh. The build version I installed should have been a clue. However, while that fixed the error of nothing being delivered to the browser, all I now see is a rather mysterious error. Here''s what I did in order to get there: $ rails panels $ cd panels $ tm . (edit with TextMate, where I pasted in the database.yml for the real db I''m using) $ script/generate scaffold Topics $ script/server Direct browser to page (At this point, my previously-working mysql app is now working again, fyi) Processing TopicsController#index (for 127.0.0.1 at Thu Jul 28 12:03:53 PDT 2005) Parameters: {"action"=>"index", "controller"=>"topics"} NameError (uninitialized constant Topic): /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:186:in `const_missing'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/core_ext/string/../../inflector.rb:59:in `const_get'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/core_ext/string/../../inflector.rb:59:in `constantize'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/core_ext/string/../../inflector.rb:58:in `inject'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/core_ext/string/../../inflector.rb:58:in `each'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/core_ext/string/../../inflector.rb:58:in `inject'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/core_ext/string/../../inflector.rb:58:in `constantize'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/core_ext/string/inflections.rb:44:in `constantize'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/pagination.rb:169:in `paginator_and_collection_for'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/pagination.rb:111:in `paginate'' /app/controllers/topics_controller.rb:8:in `list'' /app/controllers/topics_controller.rb:3:in `index'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/base.rb:756:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/base.rb:756:in `perform_action_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/filters.rb:295:in `perform_action_without_benchmark'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/benchmarking.rb:41:in `measure'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/rescue.rb:80:in `perform_action'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/base.rb:356:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/base.rb:356:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb: 105:in `handle_dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb: 71: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:155:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb: 57:in `dispatch'' script/server:49 Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/templates/rescues/layout.rhtml (500 Internal Error)
Deirdre- Try this. Make a new rails project just to have a fresh start. Then edit the database.yaml to point to the real db. Then run the scaffold command like this: $ script/generate scaffold topic Topic This tells the generator to make topic_controller.rb out of the lowercase topic. And the model topic.rb out of the uppercase Topic. You want you''re database tables to be named plural but you want your models and controller to be singular. There is a bug(feature?) in the scaffold generator that pluralizes the controller but makes a singular model if you only give it Topic on the command line. If you give it topic Topic it will make them both singular which is what your current error is all about. When you did script/generate scaffold Topic it probably made topics_controller.rb for your controller and topic.rb for your model. Well when you went to look at it in the browser and called up your url like this http://localhost: 3000/topics it is looking for a model that matches the controller topics when you model is actually topic.rb . This little issue tripped me up for some time. But if you just explicitely tell the scaffold generator what to do , you should be off to the races. Hope that helps- -Ezra On Jul 28, 2005, at 12:11 PM, Deirdre Saoirse Moen wrote:> On Jul 28, 2005, at 5:44 AM, Rick Olson wrote: > > >> Are you running beta gems? There was a glitch recently that kept >> stack traces from showing in webrick. It''s been fixed in SVN as far >> as I know, but I''m not sure how current the beta gems are. >> > > I wouldn''t have thought I was, but when I looked at the command I > did for the update, I was. Argh. The build version I installed > should have been a clue. > > However, while that fixed the error of nothing being delivered to > the browser, all I now see is a rather mysterious error. > > Here''s what I did in order to get there: > $ rails panels > $ cd panels > $ tm . (edit with TextMate, where I pasted in the database.yml for > the real db I''m using) > $ script/generate scaffold Topics > $ script/server > Direct browser to page > > (At this point, my previously-working mysql app is now working > again, fyi) > > Processing TopicsController#index (for 127.0.0.1 at Thu Jul 28 > 12:03:53 PDT 2005) > Parameters: {"action"=>"index", "controller"=>"topics"} > > > NameError (uninitialized constant Topic): > /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ > active_support/dependencies.rb:186:in `const_missing'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ > active_support/core_ext/string/../../inflector.rb:59:in `const_get'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ > active_support/core_ext/string/../../inflector.rb:59:in `constantize'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ > active_support/core_ext/string/../../inflector.rb:58:in `inject'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ > active_support/core_ext/string/../../inflector.rb:58:in `each'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ > active_support/core_ext/string/../../inflector.rb:58:in `inject'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ > active_support/core_ext/string/../../inflector.rb:58:in `constantize'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ > active_support/core_ext/string/inflections.rb:44:in `constantize'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/pagination.rb:169:in `paginator_and_collection_for'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/pagination.rb:111:in `paginate'' > /app/controllers/topics_controller.rb:8:in `list'' > /app/controllers/topics_controller.rb:3:in `index'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/base.rb:756:in `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/base.rb:756:in `perform_action_without_filters'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/filters.rb:295:in `perform_action_without_benchmark'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/benchmarking.rb:41:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/benchmarking.rb:41:in `measure'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/benchmarking.rb:41:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/rescue.rb:80:in `perform_action'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/base.rb:356:in `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/base.rb:356:in `process'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb: > 32:in `dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb: > 105:in `handle_dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb: > 71: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:155:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb: > 57:in `dispatch'' > script/server:49 > > > Rendering /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ > action_controller/templates/rescues/layout.rhtml (500 Internal Error) > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz Yakima Herald-Republic WebMaster 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
Deirdre Saoirse Moen
2005-Jul-29 01:45 UTC
[Solved] was: Re: New app, 1 scaffold, pages completely blank
On Jul 28, 2005, at 2:25 PM, Ezra Zygmuntowicz wrote:> Deirdre- > Try this. Make a new rails project just to have a fresh start. > Then edit the database.yaml to point to the real db. Then run the > scaffold command like this: > > $ script/generate scaffold topic Topic > > This tells the generator to make topic_controller.rb out of the > lowercase topic. And the model topic.rb out of the uppercase Topic. > You want you''re database tables to be named plural but you want > your models and controller to be singular. There is a bug(feature?) > in the scaffold generator that pluralizes the controller but makes > a singular model if you only give it Topic on the command line. If > you give it topic Topic it will make them both singular which is > what your current error is all about. When you did script/generate > scaffold Topic it probably made topics_controller.rb for your > controller and topic.rb for your model. Well when you went to look > at it in the browser and called up your url like this http:// > localhost:3000/topics it is looking for a model that matches the > controller topics when you model is actually topic.rb . This little > issue tripped me up for some time. But if you just explicitely tell > the scaffold generator what to do , you should be off to the races.Thank you, that did solve the issue!