I have a rails 2.3.5 app running on ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9] locally, and everything is fine. I''m trying to deploy it to my server, running centos 5.4, ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01. When I retrieve records via the app, the created_at is nil. I can pull the same records through script/console and created_at is properly set as expected. Through the app though, object.created_at is nil, object.attributes[''created_at''] is nil, but object.created_at_before_type_cast returns the proper string from the database. Any ideas what''s going on? I''m stumped. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jeff Emminger wrote:> I have a rails 2.3.5 app running on ruby 1.8.7 (2008-08-11 patchlevel > 72) [i686-darwin9] locally, and everything is fine. > > I''m trying to deploy it to my server, running centos 5.4, ruby 1.8.7 > (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby > Enterprise Edition 2010.01. > > When I retrieve records via the app, the created_at is nil. I can > pull the same records through script/console and created_at is > properly set as expected. Through the app though, object.created_at > is nil, object.attributes[''created_at''] is nil, but > object.created_at_before_type_cast returns the proper string from the > database. > > Any ideas what''s going on? I''m stumped.What database are you using? MySQL, PosgreSQL, etc.) I don''t see it listed here. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
MySQL 5.0.77 on the server On Feb 16, 7:41 pm, Robert Walker <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Jeff Emminger wrote: > > I have a rails 2.3.5 app running on ruby 1.8.7 (2008-08-11 patchlevel > > 72) [i686-darwin9] locally, and everything is fine. > > > I''m trying to deploy it to my server, running centos 5.4, ruby 1.8.7 > > (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby > > Enterprise Edition 2010.01. > > > When I retrieve records via the app, the created_at is nil. I can > > pull the same records through script/console and created_at is > > properly set as expected. Through the app though, object.created_at > > is nil, object.attributes[''created_at''] is nil, but > > object.created_at_before_type_cast returns the proper string from the > > database. > > > Any ideas what''s going on? I''m stumped. > > What database are you using? MySQL, PosgreSQL, etc.) I don''t see it > listed here. > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Feb 16, 2010 at 4:18 PM, jemminger <jemminger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a rails 2.3.5 app running on ruby 1.8.7 (2008-08-11 patchlevel > 72) [i686-darwin9] locally, and everything is fine. > > I''m trying to deploy it to my server, running centos 5.4, ruby 1.8.7 > (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby > Enterprise Edition 2010.01. > > When I retrieve records via the app, the created_at is nil. I can > pull the same records through script/console and created_at is > properly set as expected. Through the app though, object.created_at > is nil, object.attributes[''created_at''] is nil, but > object.created_at_before_type_cast returns the proper string from the > database. > >Are you started script/console in production mode? When you look at the production database does this field have a value set? Lastly, can you provide a code fragment? -Conrad> Any ideas what''s going on? I''m stumped. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> > Are you started script/console in production mode?Yes, the console is in the same environment as the app. The app is running through passenger 2.2.9> When you look at > the production database does this field have a value set?Yes, it''s fine in the database,> Lastly, can > you provide a code fragment? >In my view: <td><%= contact.created_at.to_s(:ymd) %></td> Which results in: ActionView::TemplateError (wrong number of arguments (1 for 0)) on line... pointing at the line above, because ''created_at'' is nil. I know this because changing it to <td><%= contact.created_at.to_s(:ymd) rescue contact.created_at.inspect %></td> results in "nil". Via console: [root@server current]# ./script/console staging Loading staging environment (Rails 2.3.5)>> c = Contact.find 368299=> #<Contact id: 368299, client_id: 12345, first_name: "Matt", last_name: "Android", is_active: 1, created_at: "2009-11-12 20:47:34", updated_at: nil, deleted_at: nil>>> c.created_at=> Thu, 12 Nov 2009 20:47:34 UTC +00:00>>-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I thought this might have been a Passenger bug, but I just tried with Webrick right now and I get the same problem. Any ideas on what could be different between Rails loading the objects for the web vs. the console? On Feb 16, 10:35 pm, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Are you started script/console in production mode? > > Yes, the console is in the same environment as the app. The app is > running through passenger 2.2.9 > > > When you look at > > the production database does this field have a value set? > > Yes, it''s fine in the database, > > > Lastly, can > > you provide a code fragment? > > In my view: > <td><%= contact.created_at.to_s(:ymd) %></td> > > Which results in: > ActionView::TemplateError (wrong number of arguments (1 for 0)) on > line... pointing at the line above, because ''created_at'' is nil. I > know this because changing it to > > <td><%= contact.created_at.to_s(:ymd) rescue > contact.created_at.inspect %></td> > > results in "nil". > > Via console: > > [root@server current]# ./script/console staging > Loading staging environment (Rails 2.3.5)>> c = Contact.find 368299 > > => #<Contact id: 368299, client_id: 12345, first_name: "Matt", > last_name: "Android", is_active: 1, created_at: "2009-11-12 20:47:34", > updated_at: nil, deleted_at: nil>>> c.created_at > > => Thu, 12 Nov 2009 20:47:34 UTC +00:00 > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
ben wiseley
2010-Feb-17 23:09 UTC
Re: Re: dates not being typecast properly, becoming nil?
I don''t know if this is related but I spent half my morning trying to figure out why I was getting nil.include? errors for date fields only after reloading the page (Ruby 1.8.7, Rails 2.3.5). This was the fix (in env.rb): #config.time_zone = ''UTC'' config.active_record.default_timezone = :utc On Wed, Feb 17, 2010 at 2:52 PM, jemminger <jemminger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I thought this might have been a Passenger bug, but I just tried with > Webrick right now and I get the same problem. > > Any ideas on what could be different between Rails loading the objects > for the web vs. the console? > > > > On Feb 16, 10:35 pm, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Are you started script/console in production mode? > > > > Yes, the console is in the same environment as the app. The app is > > running through passenger 2.2.9 > > > > > When you look at > > > the production database does this field have a value set? > > > > Yes, it''s fine in the database, > > > > > Lastly, can > > > you provide a code fragment? > > > > In my view: > > <td><%= contact.created_at.to_s(:ymd) %></td> > > > > Which results in: > > ActionView::TemplateError (wrong number of arguments (1 for 0)) on > > line... pointing at the line above, because ''created_at'' is nil. I > > know this because changing it to > > > > <td><%= contact.created_at.to_s(:ymd) rescue > > contact.created_at.inspect %></td> > > > > results in "nil". > > > > Via console: > > > > [root@server current]# ./script/console staging > > Loading staging environment (Rails 2.3.5)>> c = Contact.find 368299 > > > > => #<Contact id: 368299, client_id: 12345, first_name: "Matt", > > last_name: "Android", is_active: 1, created_at: "2009-11-12 20:47:34", > > updated_at: nil, deleted_at: nil>>> c.created_at > > > > => Thu, 12 Nov 2009 20:47:34 UTC +00:00 > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Yeah, I have both of those lines in my environment.rb too. Commenting out the first doesn''t seem to help my issue though, but thanks for the attempt. I''m going to try reverting to Ruby 1.8.6 next. On Feb 17, 6:09 pm, ben wiseley <wisel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I don''t know if this is related but I spent half my morning trying to figure > out why I was getting nil.include? errors for date fields only after > reloading the page (Ruby 1.8.7, Rails 2.3.5). This was the fix (in > env.rb): > > #config.time_zone = ''UTC'' > > config.active_record.default_timezone = :utc > > On Wed, Feb 17, 2010 at 2:52 PM, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I thought this might have been a Passenger bug, but I just tried with > > Webrick right now and I get the same problem. > > > Any ideas on what could be different between Rails loading the objects > > for the web vs. the console? > > > On Feb 16, 10:35 pm, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Are you started script/console in production mode? > > > > Yes, the console is in the same environment as the app. The app is > > > running through passenger 2.2.9 > > > > > When you look at > > > > the production database does this field have a value set? > > > > Yes, it''s fine in the database, > > > > > Lastly, can > > > > you provide a code fragment? > > > > In my view: > > > <td><%= contact.created_at.to_s(:ymd) %></td> > > > > Which results in: > > > ActionView::TemplateError (wrong number of arguments (1 for 0)) on > > > line... pointing at the line above, because ''created_at'' is nil. I > > > know this because changing it to > > > > <td><%= contact.created_at.to_s(:ymd) rescue > > > contact.created_at.inspect %></td> > > > > results in "nil". > > > > Via console: > > > > [root@server current]# ./script/console staging > > > Loading staging environment (Rails 2.3.5)>> c = Contact.find 368299 > > > > => #<Contact id: 368299, client_id: 12345, first_name: "Matt", > > > last_name: "Android", is_active: 1, created_at: "2009-11-12 20:47:34", > > > updated_at: nil, deleted_at: nil>>> c.created_at > > > > => Thu, 12 Nov 2009 20:47:34 UTC +00:00 > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Same problem under ruby 1.8.6 on the server. So far I seem to know: - It isn''t the ruby version, as it happens under 1.8.6, 1.8.7 and 1.9 - It isn''t the webserver, as it happens with Passenger and Webrick This would suggest it''s my app, yet the exact same app works as expected on my macbook in both development and test mode. Also the fact that on the server, I can issue the exact same statement that the controller is issuing, and I get my datetime fields parsed into ruby datetimes as expected, yet via the webserver it does not work. I''m out of ideas. On Feb 18, 1:09 am, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yeah, I have both of those lines in my environment.rb too. Commenting > out the first doesn''t seem to help my issue though, but thanks for the > attempt. I''m going to try reverting to Ruby 1.8.6 next. > > On Feb 17, 6:09 pm, ben wiseley <wisel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I don''t know if this is related but I spent half my morning trying to figure > > out why I was getting nil.include? errors for date fields only after > > reloading the page (Ruby 1.8.7, Rails 2.3.5). This was the fix (in > > env.rb): > > > #config.time_zone = ''UTC'' > > > config.active_record.default_timezone = :utc > > > On Wed, Feb 17, 2010 at 2:52 PM, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I thought this might have been a Passenger bug, but I just tried with > > > Webrick right now and I get the same problem. > > > > Any ideas on what could be different between Rails loading the objects > > > for the web vs. the console? > > > > On Feb 16, 10:35 pm, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Are you started script/console in production mode? > > > > > Yes, the console is in the same environment as the app. The app is > > > > running through passenger 2.2.9 > > > > > > When you look at > > > > > the production database does this field have a value set? > > > > > Yes, it''s fine in the database, > > > > > > Lastly, can > > > > > you provide a code fragment? > > > > > In my view: > > > > <td><%= contact.created_at.to_s(:ymd) %></td> > > > > > Which results in: > > > > ActionView::TemplateError (wrong number of arguments (1 for 0)) on > > > > line... pointing at the line above, because ''created_at'' is nil. I > > > > know this because changing it to > > > > > <td><%= contact.created_at.to_s(:ymd) rescue > > > > contact.created_at.inspect %></td> > > > > > results in "nil". > > > > > Via console: > > > > > [root@server current]# ./script/console staging > > > > Loading staging environment (Rails 2.3.5)>> c = Contact.find 368299 > > > > > => #<Contact id: 368299, client_id: 12345, first_name: "Matt", > > > > last_name: "Android", is_active: 1, created_at: "2009-11-12 20:47:34", > > > > updated_at: nil, deleted_at: nil>>> c.created_at > > > > > => Thu, 12 Nov 2009 20:47:34 UTC +00:00 > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Ruby on Rails: Talk" group. > > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
@ben: You were right after all! I had in my application controller a line where I was also setting ActiveRecord::Base.default_timezone. Removing this fixed it. Thanks again! On Feb 18, 12:22 pm, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Same problem under ruby 1.8.6 on the server. > > So far I seem to know: > > - It isn''t the ruby version, as it happens under 1.8.6, 1.8.7 and 1.9 > > - It isn''t the webserver, as it happens with Passenger and Webrick > > This would suggest it''s my app, yet the exact same app works as > expected on my macbook in both development and test mode. Also the > fact that on the server, I can issue the exact same statement that the > controller is issuing, and I get my datetime fields parsed into ruby > datetimes as expected, yet via the webserver it does not work. > > I''m out of ideas. > > On Feb 18, 1:09 am, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Yeah, I have both of those lines in my environment.rb too. Commenting > > out the first doesn''t seem to help my issue though, but thanks for the > > attempt. I''m going to try reverting to Ruby 1.8.6 next. > > > On Feb 17, 6:09 pm, ben wiseley <wisel...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I don''t know if this is related but I spent half my morning trying to figure > > > out why I was getting nil.include? errors for date fields only after > > > reloading the page (Ruby 1.8.7, Rails 2.3.5). This was the fix (in > > > env.rb): > > > > #config.time_zone = ''UTC'' > > > > config.active_record.default_timezone = :utc > > > > On Wed, Feb 17, 2010 at 2:52 PM, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I thought this might have been a Passenger bug, but I just tried with > > > > Webrick right now and I get the same problem. > > > > > Any ideas on what could be different between Rails loading the objects > > > > for the web vs. the console? > > > > > On Feb 16, 10:35 pm, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Are you started script/console in production mode? > > > > > > Yes, the console is in the same environment as the app. The app is > > > > > running through passenger 2.2.9 > > > > > > > When you look at > > > > > > the production database does this field have a value set? > > > > > > Yes, it''s fine in the database, > > > > > > > Lastly, can > > > > > > you provide a code fragment? > > > > > > In my view: > > > > > <td><%= contact.created_at.to_s(:ymd) %></td> > > > > > > Which results in: > > > > > ActionView::TemplateError (wrong number of arguments (1 for 0)) on > > > > > line... pointing at the line above, because ''created_at'' is nil. I > > > > > know this because changing it to > > > > > > <td><%= contact.created_at.to_s(:ymd) rescue > > > > > contact.created_at.inspect %></td> > > > > > > results in "nil". > > > > > > Via console: > > > > > > [root@server current]# ./script/console staging > > > > > Loading staging environment (Rails 2.3.5)>> c = Contact.find 368299 > > > > > > => #<Contact id: 368299, client_id: 12345, first_name: "Matt", > > > > > last_name: "Android", is_active: 1, created_at: "2009-11-12 20:47:34", > > > > > updated_at: nil, deleted_at: nil>>> c.created_at > > > > > > => Thu, 12 Nov 2009 20:47:34 UTC +00:00 > > > > > -- > > > > You received this message because you are subscribed to the Google Groups > > > > "Ruby on Rails: Talk" group. > > > > To post to this group, send email to rubyonrails-talk@googlegroups.com. > > > > To unsubscribe from this group, send email to > > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Conrad Taylor
2010-Feb-18 18:31 UTC
Re: Re: dates not being typecast properly, becoming nil?
On Tue, Feb 16, 2010 at 7:35 PM, jemminger <jemminger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > > Are you started script/console in production mode? > > Yes, the console is in the same environment as the app. The app is > running through passenger 2.2.9 > > > When you look at > > the production database does this field have a value set? > > Yes, it''s fine in the database, > > > Lastly, can > > you provide a code fragment? > > > > In my view: > <td><%= contact.created_at.to_s(:ymd) %></td> > >From the Rails 2.3.5 API, the above should be written as follows: <td><%= contact.created_at.to_s %></td> Perhaps, there''s something within your code that you''re not displaying here because I wasn''t able to reproduce the error message. Thus, could you post a complete code fragment that reproduces the the below error message? -Conrad> Which results in: > ActionView::TemplateError (wrong number of arguments (1 for 0)) on > line... pointing at the line above, because ''created_at'' is nil. I > know this because changing it to > > <td><%= contact.created_at.to_s(:ymd) rescue > contact.created_at.inspect %></td> > > results in "nil". > > > > Via console: > > [root@server current]# ./script/console staging > Loading staging environment (Rails 2.3.5) > >> c = Contact.find 368299 > => #<Contact id: 368299, client_id: 12345, first_name: "Matt", > last_name: "Android", is_active: 1, created_at: "2009-11-12 20:47:34", > updated_at: nil, deleted_at: nil> > >> c.created_at > => Thu, 12 Nov 2009 20:47:34 UTC +00:00 > >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Conrad, :ymd is a custom format I''ve defined in my environment.rb. The issue is resolved however; see a few posts above. Thanks, Jeff On Feb 18, 1:31 pm, Conrad Taylor <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Tue, Feb 16, 2010 at 7:35 PM, jemminger <jemmin...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Are you started script/console in production mode? > > > Yes, the console is in the same environment as the app. The app is > > running through passenger 2.2.9 > > > > When you look at > > > the production database does this field have a value set? > > > Yes, it''s fine in the database, > > > > Lastly, can > > > you provide a code fragment? > > > In my view: > > <td><%= contact.created_at.to_s(:ymd) %></td> > > From the Rails 2.3.5 API, the above should be written as follows: > > <td><%= contact.created_at.to_s %></td> > > Perhaps, there''s something within your code that you''re not displaying > here because I wasn''t able to reproduce the error message. > Thus, could you post a complete code fragment that reproduces the > the below error message? > > -Conrad > > > Which results in: > > ActionView::TemplateError (wrong number of arguments (1 for 0)) on > > line... pointing at the line above, because ''created_at'' is nil. I > > know this because changing it to > > > <td><%= contact.created_at.to_s(:ymd) rescue > > contact.created_at.inspect %></td> > > > results in "nil". > > > Via console: > > > [root@server current]# ./script/console staging > > Loading staging environment (Rails 2.3.5) > > >> c = Contact.find 368299 > > => #<Contact id: 368299, client_id: 12345, first_name: "Matt", > > last_name: "Android", is_active: 1, created_at: "2009-11-12 20:47:34", > > updated_at: nil, deleted_at: nil> > > >> c.created_at > > => Thu, 12 Nov 2009 20:47:34 UTC +00:00 > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.