Robert Sherwood
2006-Apr-23 19:58 UTC
[Rails] Newbie .. nil object and missing something obvious
Trying to do first project in Ruby on Rails, and I''m getting the dreaded nil object exception. I''ve reduced the code to what I think is the minimal case, and it''s still not working. Code presented below.. ---------------------------------------------------------------------- in "app/controllers/dashboard_controller.rb" class DashboardController < ApplicationController def display_calendar @dates[0] = Date.Today @dates << Date.Today + 1 end end in "app/views/dashboard/display_calendar.rhtml" <h1>Display Calendar</h1> <p> First day should be <%= Date.today %><br/> Second day should be <%= Date.today + 1 %> First day is <%= @dates[0] %> </p> ------------------------------------------------------------------- The fact that the page is getting a nil suggests that the controller is not setting @dates properly. However, the code is so simple that I''m sure I''m missing something fundamental. Any suggestions? Thanks in advance for your help. -- Posted via ruby-forum.com.
Lindsay Boyd
2006-Apr-23 20:11 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
Robert Sherwood wrote:> Trying to do first project in Ruby on Rails, and I''m getting the dreaded > nil object exception.What happens if you change ''@dates[0] = Date.Today'' to ''@dates = Date.Today''? -Lindsay -- Posted via ruby-forum.com.
Robert Sherwood
2006-Apr-23 20:22 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
> What happens if you change ''@dates[0] = Date.Today'' to ''@dates = > Date.Today''?Thanks for you reply. I have tried that variation, but I''m getting the same error. In the other statement, will @dates still be an array, and will @dates[0] be meaningful? How does Ruby know that it is building @dates as an array of date objects, rather than a single Date? -- Posted via ruby-forum.com.
Robert Sherwood
2006-Apr-23 20:49 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
I realized it would be helpful to print the entire error: -------------------------------------------------------------------------- Showing app/views/dashboard/display_calendar.rhtml where line #6 raised: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] Extracted source (around line #6): 3: <p> 4: First day should be <%= Date.today %><br/> 5: Second day should be <%= Date.today + 1 %> 6: First day is <%= @dates[0] %> 7: </p> RAILS_ROOT: script/../config/.. -- Posted via ruby-forum.com.
Kevin Olbrich
2006-Apr-23 20:52 UTC
[Rails] Newbie .. nil object and missing something obvious
Can you post the exact error message you are getting? Also, in your example, you use ''Date.Today'' and ''Date.today'' (note the capitalization). That could cause problems if it isn''t just a typo. You can also put ''puts @dates[0]'' in the controller and the message should show up on your WEBrick console. Try the display_calendar function in irb to make sure it is doing what you think it should. on Sunday, April 23, 2006, at 9:58 PM, Robert Sherwood wrote:>Trying to do first project in Ruby on Rails, and I''m getting the dreaded >nil object exception. I''ve reduced the code to what I think is the >minimal case, and it''s still not working. Code presented below.. >---------------------------------------------------------------------- >in "app/controllers/dashboard_controller.rb" > >class DashboardController < ApplicationController > def display_calendar > @dates[0] = Date.Today > @dates << Date.Today + 1 > end >end > >in "app/views/dashboard/display_calendar.rhtml" > ><h1>Display Calendar</h1> > ><p> > First day should be <%= Date.today %><br/> > Second day should be <%= Date.today + 1 %> > First day is <%= @dates[0] %> ></p> >------------------------------------------------------------------- > >The fact that the page is getting a nil suggests that the controller is >not setting @dates properly. However, the code is so simple that I''m >sure I''m missing something fundamental. Any suggestions? > >Thanks in advance for your help. > >-- >Posted via ruby-forum.com. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
Jeff Coleman
2006-Apr-23 20:57 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
Robert Sherwood wrote:> The fact that the page is getting a nil suggests that the controller is > not setting @dates properly. However, the code is so simple that I''m > sure I''m missing something fundamental. Any suggestions? > > Thanks in advance for your help.irb(main):001:0> x = Date.Today NoMethodError: undefined method `Today'' for Date:Class from (irb):1 irb(main):002:0> x = Date.today => #<Date: 4907697/2,0,2299161> irb(main):003:0> Jeff Coleman -- Posted via ruby-forum.com.
Kevin Olbrich
2006-Apr-23 20:58 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
That helps some... @dates does not exist for some reason. I think you need to initialize @dates as an array before you use it.. try this.. def display_calendar @dates = [Date.today, Date.today+1] end On Sunday, April 23, 2006, at 10:48 PM, Robert Sherwood wrote:>I realized it would be helpful to print the entire error: > >-------------------------------------------------------------------------- > >Showing app/views/dashboard/display_calendar.rhtml where line #6 raised: > >You have a nil object when you didn''t expect it! >You might have expected an instance of Array. >The error occured while evaluating nil.[] > >Extracted source (around line #6): > >3: <p> >4: First day should be <%= Date.today %><br/> >5: Second day should be <%= Date.today + 1 %> >6: First day is <%= @dates[0] %> >7: </p> > >RAILS_ROOT: script/../config/.. > > >-- >Posted via ruby-forum.com. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
Tom Mornini
2006-Apr-23 21:23 UTC
[Rails] Newbie .. nil object and missing something obvious
On Apr 23, 2006, at 12:58 PM, Robert Sherwood wrote:> <p> > First day should be <%= Date.today %><br/> > Second day should be <%= Date.today + 1 %> > First day is <%= @dates[0] %> > </p>The other folks solved your problem, but I''ll throw in a style tip: <p> First day should be <%= Date.today %><br/> Second day should be <%= Date.today + 1 %> First day is <%= @dates.first %> Last day is <%= @dates.last %> </p> Additionally, rails provides some really nice date routines. 1.day.from_now -- -- Tom Mornini
Robert Sherwood
2006-Apr-24 01:13 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
Thanks so much for everyone''s help. Lot''s of good advice. I''m still having the problem, but I appreciate everyone''s patience so far. Let me print the new code and error: ------------------------------------------------------------------------ app/controllers/dashboard_controller.rb ------------------------------------------------------------------------ class DashboardController < ApplicationController def display_calendar @dates = [Date.today, Date.today + 1] end end ------------------------------------------------------------------------ app/views/dashboard/display_calendar.rhtml ------------------------------------------------------------------------ <h1>Display Calendar</h1> <p> First day should be <%= Date.today %><br/> Second day should be <%= Date.today + 1 %><br/> First day is <%= @dates.first %><br/> Last day is <%= @dates.last %> </p> ------------------------------------------------------------------------ Error page: ------------------------------------------------------------------------ NoMethodError in Dashboard#display_calendar.rhtml Showing app/views/dashboard/display_calendar.rhtml where line #6 raised: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.first Extracted source (around line #6): 3: <p> 4: First day should be <%= Date.today %><br/> 5: Second day should be <%= Date.today + 1 %><br/> 6: First day is <%= @dates.first %><br/> 7: Last day is <%= @dates.last %> 8: </p> ------------------------------------------------------------------------ As an earlier poster suggested, it looks like @dates isn''t being initialized. What''s driving me crazy is that the code is so simple, I don''t understand what can be going wrong. It''s a simple assignment and display. At another poster''s suggestion, I have run the code through irb: irb(main):015:0> dates = [Date.today, Date.today + 1] => [#<Date: 4907697/2,0,2299161>, #<Date: 4907699/2,0,2299161>] irb(main):016:0> puts dates[0] 2006-04-23 => nil irb(main):017:0> puts dates[1] 2006-04-24 => nil irb(main):018:0> puts dates.first 2006-04-23 => nil irb(main):019:0> puts dates.last 2006-04-24 => nil Of course, the differnce here is that not using an instance variable. Could that be the problem? I''m sure I''ve seen instance variables used for this purpose in other code. In any case. Thanks to everyone for your help so far.. -- Posted via ruby-forum.com.
Kevin Olbrich
2006-Apr-24 01:26 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
Hmmm... now this is getting weird. Try putting a ''<%= @dates.inspect %>'' in there. What version of rails/ruby are you running? On Monday, April 24, 2006, at 3:13 AM, Robert Sherwood wrote:>Thanks so much for everyone''s help. Lot''s of good advice. I''m still >having the problem, but I appreciate everyone''s patience so far. > >Let me print the new code and error: >------------------------------------------------------------------------ >app/controllers/dashboard_controller.rb >------------------------------------------------------------------------ >class DashboardController < ApplicationController > def display_calendar > @dates = [Date.today, Date.today + 1] > end >end >------------------------------------------------------------------------ >app/views/dashboard/display_calendar.rhtml >------------------------------------------------------------------------ ><h1>Display Calendar</h1> > ><p> > First day should be <%= Date.today %><br/> > Second day should be <%= Date.today + 1 %><br/> > First day is <%= @dates.first %><br/> > Last day is <%= @dates.last %> ></p> > >------------------------------------------------------------------------ >Error page: >------------------------------------------------------------------------ >NoMethodError in Dashboard#display_calendar.rhtml > >Showing app/views/dashboard/display_calendar.rhtml where line #6 raised: > >You have a nil object when you didn''t expect it! >You might have expected an instance of Array. >The error occured while evaluating nil.first > >Extracted source (around line #6): > >3: <p> >4: First day should be <%= Date.today %><br/> >5: Second day should be <%= Date.today + 1 %><br/> >6: First day is <%= @dates.first %><br/> >7: Last day is <%= @dates.last %> >8: </p> >------------------------------------------------------------------------ > >As an earlier poster suggested, it looks like @dates isn''t being >initialized. What''s driving me crazy is that the code is so simple, I >don''t understand what can be going wrong. It''s a simple assignment and >display. At another poster''s suggestion, I have run the code through >irb: > >irb(main):015:0> dates = [Date.today, Date.today + 1] >=> [#<Date: 4907697/2,0,2299161>, #<Date: 4907699/2,0,2299161>] >irb(main):016:0> puts dates[0] >2006-04-23 >=> nil >irb(main):017:0> puts dates[1] >2006-04-24 >=> nil >irb(main):018:0> puts dates.first >2006-04-23 >=> nil >irb(main):019:0> puts dates.last >2006-04-24 >=> nil > >Of course, the differnce here is that not using an instance variable. >Could that be the problem? I''m sure I''ve seen instance variables used >for this purpose in other code. > >In any case. Thanks to everyone for your help so far.. > >-- >Posted via ruby-forum.com. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
Robert Sherwood
2006-Apr-24 01:39 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
Kevin Olbrich wrote:> Hmmm... now this is getting weird. Try putting a ''<%= @dates.inspect > %>'' in there.Changes listed below: ------------------------------------------------------------------------ app/views/dashboard/display_calendar.rhtml ------------------------------------------------------------------------ <h1>Display Calendar</h1> <p> First day should be <%= Date.today %><br/> Second day should be <%= Date.today + 1 %><br/> <%= @dates.inspect %> </p> ------------------------------------------------------------------------ Output: ------------------------------------------------------------------------ Display Calendar First day should be 2006-04-23 Second day should be 2006-04-24 nil> What version of rails/ruby are you running?$ ruby --version ruby 1.8.4 (2005-12-24) [i486-linux] $ rails --version Rails 1.1.2 Thanks again to everyone for the help. I''m going to try regenerating the project with the rails command, adding just those two files, and reloading... -- Posted via ruby-forum.com.
Robert Sherwood
2006-Apr-24 01:45 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
> Thanks again to everyone for the help. I''m going to try regenerating the > project with the rails command, adding just those two files, and > reloading...Okay, that didn''t work. However, I''ve tried some of the code on the console. Of course, it works there..>> @dates = [Date.today, Date.today + 1]=> [#<Date: 4907697/2,0,2299161>, #<Date: 4907699/2,0,2299161>]>> @dates.first=> #<Date: 4907697/2,0,2299161>>> puts @dates.first2006-04-23 => nil>> puts @dates.last2006-04-24 => nil Crazymaking! -- Posted via ruby-forum.com.
Kevin Olbrich
2006-Apr-24 02:20 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
Try putting a ''puts @dates.inspect'' into the controller action at the end. Then check your WEBrick console window after the request to see what it outputs. My only other suggestion at this point would be to rename @dates to something like @array1. On Monday, April 24, 2006, at 3:45 AM, Robert Sherwood wrote:>> Thanks again to everyone for the help. I''m going to try regenerating the >> project with the rails command, adding just those two files, and >> reloading... > >Okay, that didn''t work. However, I''ve tried some of the code on the >console. Of course, it works there.. > >>> @dates = [Date.today, Date.today + 1] >=> [#<Date: 4907697/2,0,2299161>, #<Date: 4907699/2,0,2299161>] >>> @dates.first >=> #<Date: 4907697/2,0,2299161> >>> puts @dates.first >2006-04-23 >=> nil >>> puts @dates.last >2006-04-24 >=> nil > > >Crazymaking! > >-- >Posted via ruby-forum.com. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
Robert Sherwood
2006-Apr-24 02:39 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
Kevin, thank you for your help..> Try putting a ''puts @dates.inspect'' into the controller action at the > end. Then check your WEBrick console window after the request to see > what it outputs.Okay. Nothing listed in the output of the Console. Just for S+G''s I added a "puts ''Testing''" to check. I also added a bogus variable to the .rhtml file and tried again. The bogus variable (@nothing) is also nil. Finally, I commented out the entire "display_calendar" method in the controller, and I got the same output, rather than the usual "missing method" or "no method responds to <blah, blah...>" So my question is this. Is it possible that control is not being routed through the dashboard method? How can I confirm that.. also, why does rails hate me so much :)? I''m going to start digging through the dispatcher code (I think that''s what it''s called).> > My only other suggestion at this point would be to rename @dates to > something like @array1. >I thought maybe dates was some undocumented reserved word, so a couple of days ago I tried @xyz.. no dice. -- Posted via ruby-forum.com.
Robert Sherwood
2006-Apr-24 02:54 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
Okay, started a new application with "rails Test_site". Created new controller with "./scripts/generate controller dashboard diplay_calendar" Copied text from previously buggy code into newly generated controller. Still having the same problem.. I''m off to bed, Thanks again to everyone who has helped. -- Posted via ruby-forum.com.
Tom Mornini
2006-Apr-24 02:58 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
What URL are you accessing during testing? -- -- Tom Mornini On Apr 23, 2006, at 7:54 PM, Robert Sherwood wrote:> Okay, started a new application with "rails Test_site". Created new > controller with "./scripts/generate controller dashboard > diplay_calendar" Copied text from previously buggy code into newly > generated controller. Still having the same problem.. I''m off to bed, > Thanks again to everyone who has helped. > > -- > Posted via ruby-forum.com. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails
Kevin Olbrich
2006-Apr-24 03:02 UTC
[Rails] Re: Newbie .. nil object and missing something obvious
1. Make sure there are no other web servers running 2. make sure you are running in the ''development'' environment 3. check your routes.rb file for problems. Your server may be serving up the .rhtml file directly 4. make sure you test it with WEBrick or Mongrel. Disable apache if it is running. As for why Rails hates you... my guess is that she smells XML on your breath and she thinks you''ve been cheating on her with Java. ;) On Monday, April 24, 2006, at 4:39 AM, Robert Sherwood wrote:>Kevin, thank you for your help.. > >> Try putting a ''puts @dates.inspect'' into the controller action at the >> end. Then check your WEBrick console window after the request to see >> what it outputs. > >Okay. Nothing listed in the output of the Console. Just for S+G''s I >added a "puts ''Testing''" to check. I also added a bogus variable to the >.rhtml file and tried again. The bogus variable (@nothing) is also nil. >Finally, I commented out the entire "display_calendar" method in the >controller, and I got the same output, rather than the usual "missing >method" or "no method responds to <blah, blah...>" > >So my question is this. Is it possible that control is not being routed >through the dashboard method? How can I confirm that.. also, why does >rails hate me so much :)? I''m going to start digging through the >dispatcher code (I think that''s what it''s called). > >> >> My only other suggestion at this point would be to rename @dates to >> something like @array1. >> > >I thought maybe dates was some undocumented reserved word, so a couple >of days ago I tried @xyz.. no dice. > >-- >Posted via ruby-forum.com. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
Robert Sherwood
2006-Apr-24 03:37 UTC
[Rails] Re: Re: Newbie .. nil object and missing something obvious
Tom Mornini wrote:> What URL are you accessing during testing?localhost:3000/dashboard/display_calendar.rhtml Thanks -- Posted via ruby-forum.com.
Bill Walton
2006-Apr-24 04:15 UTC
[Rails] Re: Re: Newbie .. nil object and missing something obvious
Robert Sherwood wrote:> Tom Mornini wrote: >> What URL are you accessing during testing?Excellent sleuthing, Tom!> > localhost:3000/dashboard/display_calendar.rhtml >Robert, In Rails, your URL should point to the controller action, not the view it renders. Drop the ".rhtml". hth, Bill
Tom Mornini
2006-Apr-24 04:54 UTC
[Rails] Re: Re: Newbie .. nil object and missing something obvious
On Apr 23, 2006, at 9:14 PM, Bill Walton wrote:> Robert Sherwood wrote: > >> Tom Mornini wrote: >>> What URL are you accessing during testing? > > Excellent sleuthing, Tom!Thanks.>> localhost:3000/dashboard/display_calendar.rhtml > > Robert, > > In Rails, your URL should point to the controller action, not the > view it renders. Drop the ".rhtml".Learn something new every day! Why is rails trying to serve up .rhtml files if they''re not under public? I think this requires a bug report to be filed! -- -- Tom Mornini
Robert Sherwood
2006-Apr-24 13:02 UTC
[Rails] Re: Re: Re: Newbie .. nil object and missing something obvio
Thanks to everyone for the help. Okay, I''ve got an update from bizarro world. Someone kindly volunteered to try the code in their environment, after failing to reproduce the error. I zipped up the application, sent it over, and <Drum roll please.....>>It works; I get the dates displayed. I didn''t change anything at all, >so that''s absolute proof that the application code itself is not to >blame.So now I''m going to go jump off a bridge... :) I will try the URL without the ".rhtml", unfortunately, I''ll have to wait ''til this evening after work. Thanks again to everyone for your patience and assistance. -- Posted via ruby-forum.com.
Kevin Olbrich
2006-Apr-24 13:08 UTC
[Rails] Re: Re: Re: Newbie .. nil object and missing something obvio
Yeah, the URL is probably getting you. The webserver is sending you the file directly without running the controller first. I''m pretty sure it will work without the extension. On Monday, April 24, 2006, at 3:01 PM, Robert Sherwood wrote:>Thanks to everyone for the help. > >Okay, I''ve got an update from bizarro world. Someone kindly volunteered >to try the code in their environment, after failing to reproduce the >error. I zipped up the application, sent it over, and <Drum roll >please.....> > >>It works; I get the dates displayed. I didn''t change anything at all, >>so that''s absolute proof that the application code itself is not to >>blame. > >So now I''m going to go jump off a bridge... :) > >I will try the URL without the ".rhtml", unfortunately, I''ll have to >wait ''til this evening after work. > >Thanks again to everyone for your patience and assistance. > >-- >Posted via ruby-forum.com. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
dblack@wobblini.net
2006-Apr-24 13:29 UTC
[Rails] Re: Re: Re: Newbie .. nil object and missing something obvio
Hi -- On Mon, 24 Apr 2006, Robert Sherwood wrote:> Thanks to everyone for the help. > > Okay, I''ve got an update from bizarro world. Someone kindly volunteered > to try the code in their environment, after failing to reproduce the > error. I zipped up the application, sent it over, and <Drum roll > please.....> > >> It works; I get the dates displayed. I didn''t change anything at all, >> so that''s absolute proof that the application code itself is not to >> blame. > > So now I''m going to go jump off a bridge... :) > > I will try the URL without the ".rhtml", unfortunately, I''ll have to > wait ''til this evening after work.I can confirm that *with* the .rhtml, I get the same result you do. I believe the problem is solved. (Except that, as another poster pointed out, it''s kind of disconcerting that the view templates are reachable this way at all.) David -- David A. Black (dblack@wobblini.net) Ruby Power and Light, LLC (rubypowerandlight.com) "Ruby for Rails" PDF now on sale! manning.com/black Paper version coming in early May!
Bill Walton
2006-Apr-24 15:20 UTC
[Rails] Re: Re: Re: Newbie .. nil object and missing something obvio
Hi Robert, Robert Sherwood wrote: <snip>> Okay, I''ve got an update from bizarro world. > Someone kindly volunteered to try the code in > their environment, after failing to reproduce the > error. I zipped up the application, sent it over, > and <Drum roll please..... > >>It works; I get the dates displayed. I didn''t > change anything at all, so that''s absolute proof > that the application code itself is not to > blame.You appear to have a piece of code that exposes a config-specific bug in RoR. I, for one, would be grateful if you could make the time to document your configuration and submit that and your code so that the bug can either be tracked down and fixed or a FAQ developed to warn folks off of using that config. Best regards, Bill
Kevin Olbrich
2006-Apr-24 15:32 UTC
[Rails] Re: Re: Re: Newbie .. nil object and missing something
Actually, I can reproduce his problem using the standard cookbook app that comes with InstantRails. At least in development mode, if you request the .rhtml file, you will get it. I don''t know if production mode closes this hole or not. It does not seem to be anything specific to his own configuration. On Monday, April 24, 2006, at 10:19 AM, Bill Walton wrote:>Hi Robert, > >Robert Sherwood wrote: ><snip> > >> Okay, I''ve got an update from bizarro world. >> Someone kindly volunteered to try the code in >> their environment, after failing to reproduce the >> error. I zipped up the application, sent it over, >> and <Drum roll please..... >> >>>It works; I get the dates displayed. I didn''t >> change anything at all, so that''s absolute proof >> that the application code itself is not to >> blame. > >You appear to have a piece of code that exposes a config-specific bug in >RoR. I, for one, would be grateful if you could make the time to document >your configuration and submit that and your code so that the bug can >either >be tracked down and fixed or a FAQ developed to warn folks off of >using that >config. > >Best regards, >Bill > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
Hi Kevin, A couple of additional thoughts below... Kevin Olbrich wrote:> Actually, I can reproduce his problem using > the standard cookbook app that comes with > InstantRails. At least in development mode, if you > request the .rhtml file, you will get it. I don''t know > if production mode closes this hole or not. > > It does not seem to be anything specific to his own > configuration.Perfect! Not speaking for anybody but me... thanks much for making the time to test that. If the two of you could find a way to spend just a little additional time on this, it would be great to validate something. To both of you, what exactly is your system configuration? For Robert, what about your friend''s config. I ask because for the past week I have, and still am, spending quite a bit of time testing / debugging a segment fault problem that''s specific, at least, to Windows 2000 Pro SP3 and SP4. Can''t get the problem to display itself on XP. That doesn''t mean it''s not a bug. It means that it''s a bug that only shows itself in a specific config. It either needs to be fixed, or if the effort to fix it for that config is not justified from a ''market share'' perspective, then it at least needs to be documented. It may be that both you and Robert are running the same config and that his friend is running a different one. It would be good to validate that this is not config-specific. Independent of the results above, it seems to me we need ''a call'' from the Rails core team as to this behavior. Is there a ''better'' way than just going ahead and submitting it as a bug? Best regards, Bill It may be that Rails is ''working as designed / intended'' and there''s something that needs to be *highlighted* in the documentation. It may already be documented, for example, that this is allowed in development for reason ''X'' and that before moving a Rails app into production, we need to do ''A'', ''B'', and ''C''.
As a follow up, I too can reproduce the ''NoMethodError in Recipe#list.rhtml'' by starting the cookbook app that comes with InstantRails by pointing the browser to ''localhost:300/recipe/list.rhtml''. That''s reproducible on the two boxes I have here: WinXP - Home Addition and Win2K SP 4. Tom Mornini, You caught this. You should get the ''glory'' (aka, ''the extra work'' ;-) ) You going to submit the bug report? Best regards, Bill ----- Original Message ----- From: "Bill Walton" <bill.walton@charter.net> To: <rails@lists.rubyonrails.org> Sent: Monday, April 24, 2006 11:11 AM Subject: Re: [Rails] Newbie .. nil object and missing something> Hi Kevin, > > A couple of additional thoughts below... > > Kevin Olbrich wrote: > > >> Actually, I can reproduce his problem using >> the standard cookbook app that comes with >> InstantRails. At least in development mode, if you >> request the .rhtml file, you will get it. I don''t know >> if production mode closes this hole or not. >> >> It does not seem to be anything specific to his own >> configuration. > > Perfect! Not speaking for anybody but me... thanks much for making the > time to test that. If the two of you could find a way to spend just a > little additional time on this, it would be great to validate something. > > To both of you, what exactly is your system configuration? For Robert, > what about your friend''s config. I ask because for the past week I have, > and still am, spending quite a bit of time testing / debugging a segment > fault problem that''s specific, at least, to Windows 2000 Pro SP3 and SP4. > Can''t get the problem to display itself on XP. That doesn''t mean it''s not > a bug. It means that it''s a bug that only shows itself in a specific > config. It either needs to be fixed, or if the effort to fix it for that > config is not justified from a ''market share'' perspective, then it at > least needs to be documented. It may be that both you and Robert are > running the same config and that his friend is running a different one. > It would be good to validate that this is not config-specific. > > Independent of the results above, it seems to me we need ''a call'' from the > Rails core team as to this behavior. Is there a ''better'' way than just > going ahead and submitting it as a bug? > > Best regards, > Bill > > It may be that Rails is ''working as designed / intended'' and there''s > something that needs to be *highlighted* in the documentation. It may > already be documented, for example, that this is allowed in development > for reason ''X'' and that before moving a Rails app into production, we need > to do ''A'', ''B'', and ''C''. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > lists.rubyonrails.org/mailman/listinfo/rails >
I''m using InstantRails on a WinXP machine. As I said before, I don''t think this is a configuration dependent thing. It does seem to happen for me in production mode, but I would appreciate it if someone could verify that. On Monday, April 24, 2006, at 11:11 AM, Bill Walton wrote:>Hi Kevin, > >A couple of additional thoughts below... > >Kevin Olbrich wrote: > > >> Actually, I can reproduce his problem using >> the standard cookbook app that comes with >> InstantRails. At least in development mode, if you >> request the .rhtml file, you will get it. I don''t know >> if production mode closes this hole or not. >> >> It does not seem to be anything specific to his own >> configuration. > >Perfect! Not speaking for anybody but me... thanks much for making >the time >to test that. If the two of you could find a way to spend just a little >additional time on this, it would be great to validate something. > >To both of you, what exactly is your system configuration? For >Robert, what >about your friend''s config. I ask because for the past week I have, and >still am, spending quite a bit of time testing / debugging a segment fault >problem that''s specific, at least, to Windows 2000 Pro SP3 and SP4. Can''t >get the problem to display itself on XP. That doesn''t mean it''s not >a bug. >It means that it''s a bug that only shows itself in a specific config. It >either needs to be fixed, or if the effort to fix it for that config >is not >justified from a ''market share'' perspective, then it at least needs to be >documented. It may be that both you and Robert are running the same >config >and that his friend is running a different one. It would be good to >validate that this is not config-specific. > >Independent of the results above, it seems to me we need ''a call'' from the >Rails core team as to this behavior. Is there a ''better'' way than just >going ahead and submitting it as a bug? > >Best regards, >Bill > >It may be that Rails is ''working as designed / intended'' and there''s >something that needs to be *highlighted* in the documentation. It may >already be documented, for example, that this is allowed in >development for >reason ''X'' and that before moving a Rails app into production, we >need to do >''A'', ''B'', and ''C''. > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
On Apr 24, 2006, at 9:36 AM, Bill Walton wrote:> As a follow up, I too can reproduce the ''NoMethodError in > Recipe#list.rhtml'' by starting the cookbook app that comes with > InstantRails by pointing the browser to ''localhost:300 > recipe/list.rhtml''. That''s reproducible on the two boxes I have > here: WinXP - Home Addition and Win2K SP 4. > > Tom Mornini, > > You caught this. You should get the ''glory'' (aka, ''the extra > work'' ;-) ) You going to submit the bug report?The glory belongs to the person who submits a patch to fix it. :-) dev.rubyonrails.org/ticket/4866 -- -- Tom Mornini
Tom Mornini wrote:> On Apr 24, 2006, at 9:36 AM, Bill Walton wrote: > >> Tom Mornini, >> >> You caught this. You should get the ''glory'' (aka, ''the extra work'' >> ;-) ) You going to submit the bug report? > > The glory belongs to the person who submits a patch to > fix it. :-) > > dev.rubyonrails.org/ticket/4866Or to the person who updates the wiki FAQs if that''s the decision by the core team. In any event, I''ve never been a big supporter of the "Lone Ranger" model for recognition / thanks. Personally speaking, I''ve always had / observed better results from a team / credit-where-credit''s-due model. ;-) Best regards, Bill
Kevin Olbrich wrote:> > It does seem to happen for me > in production mode,Ouch! Are you planning to update the ticket Tom entered?> but I would appreciate > it if someone could verify that.+1 Best regards, Bill
updated. FYI, it''s ticket #4866 dev.rubyonrails.org/ticket/4866#preview On Monday, April 24, 2006, at 12:57 PM, Bill Walton wrote:>Kevin Olbrich wrote: >> >> It does seem to happen for me >> in production mode, > >Ouch! Are you planning to update the ticket Tom entered? > >> but I would appreciate >> it if someone could verify that. > >+1 > >Best regards, >Bill >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
Robert Sherwood
2006-Apr-24 18:22 UTC
[Rails] Re: Newbie .. nil object and missing something
Newbie here... Would it still be useful for me to post details of my environment? It seems pretty universally reproduceable, so I''m not sure there''s significant benefit in doing so. -- Posted via ruby-forum.com.
Hi Robert, Robert Sherwood wrote:> Would it still be useful for me to > post details of my environment?If your config has already been accounted for, then probably not.> It seems pretty universally reproduceable, > so I''m not sure there''s significant benefit > in doing so.What would be most valuable at this point, I think, is understanding what the config is on the system that did *not* exhibit the failure. From a testing / debugging perspective, knowing both cases can significantly reduce the effort to understand / fix the problem. Thanks again for making the time to report / drive this to ground. It is, IMHO, a real service to the community. Best regards, Bill
Kevin Olbrich
2006-Apr-24 18:39 UTC
[Rails] Re: Newbie .. nil object and missing something
I doubt it will help much at this point. On Monday, April 24, 2006, at 8:20 PM, Robert Sherwood wrote:>Newbie here... > >Would it still be useful for me to post details of my environment? It >seems pretty universally reproduceable, so I''m not sure there''s >significant benefit in doing so. > >-- >Posted via ruby-forum.com. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
Kevin Olbrich
2006-Apr-24 18:46 UTC
[Rails] Re: Newbie .. nil object and missing something
My immediate suspicion is that his friend actually tried the standard rails url (without the .rhtml), and that is why it worked for him. On Monday, April 24, 2006, at 1:36 PM, Bill Walton wrote:>Hi Robert, > >Robert Sherwood wrote: > >> Would it still be useful for me to >> post details of my environment? > >If your config has already been accounted for, then probably not. > >> It seems pretty universally reproduceable, >> so I''m not sure there''s significant benefit >> in doing so. > >What would be most valuable at this point, I think, is understanding what >the config is on the system that did *not* exhibit the failure. From a >testing / debugging perspective, knowing both cases can >significantly reduce >the effort to understand / fix the problem. > >Thanks again for making the time to report / drive this to ground. It is, >IMHO, a real service to the community. > >Best regards, >Bill > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >lists.rubyonrails.org/mailman/listinfo/rails_Kevin -- Posted with DevLists.com. Sign up and save your mailbox.
Robert Sherwood
2006-Apr-24 18:47 UTC
[Rails] Re: Re: Newbie .. nil object and missing something
> What would be most valuable at this point, I think, is understanding > what > the config is on the system that did *not* exhibit the failure. From a > testing / debugging perspective, knowing both cases can significantly > reduce > the effort to understand / fix the problem.That person was able to reproduce the problem by appending "*.rhtml" to their call, just as I did. Originally, they had done the right thing and called just "controller/action", instead of "controller/action.rhtml". So it looks like a combination of user error, and unexpected system behavior. -- Posted via ruby-forum.com.
Bill Walton
2006-Apr-24 18:58 UTC
[Rails] Re: Re: Newbie .. nil object and missing something
Robert Sherwood wrote:> > That person was able to reproduce > the problem by appending "*.rhtml" to > their call, just as I did.Then, other than the production mode question, I''d say it''s in the core team''s court. Thanks again! Bill