Colin A. Bartlett on 3 Jun 2008 12:41:03 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] Moving to a windows server continued, another error, need some help, thanks


This is a pretty common error. It occurs when you're trying to run methods on objects that don't exist (or are set to nil). I would suspect it has less to do with the deployment then you think.

And I'll avoid picking at some of the silliness in your code. =) But try and figure out why self.value is nil. I imagine "value" is another instance method on the attribute model? Perhaps it's even a column on your database?

Colin

On Jun 3, 2008, at 3:28 PM, Ezra Wolfe wrote:


Hi all,

In our continuing saga of deploying a RoR app on a Windows 2003 server, I've got a new error I need help trying to troubleshoot (see below).

We've got the same codebase deployed directly form svn, and the same db structure. Seems like everything is working fine except for this particular view.

Can anyone give me a clue on how to troubleshoot this? I've Googled it and most suggestions point to the code or database, which I think we've pretty much ruled out.

---------------------------------------------
A ActionView::TemplateError occurred in calendar_admin#add_event:

  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.empty?
  On line #11 of app/views/nodes/_attribute.rhtml

    8: </label>
    9: <% error = error_message_on(:attr, :akey) %>
    10: <%= "<div class=/"fieldWithErrors/">" unless error.nil? %>
    11: <%= @attr.render_control
    12: %>
    13: <%= "</div>" unless error.nil? %>
    14:

    #{RAILS_ROOT}/app/models/attribute.rb:403:in `render_date'
    #{RAILS_ROOT}/app/models/attribute.rb:381:in `send'
    #{RAILS_ROOT}/app/models/attribute.rb:381:in `render_control'
#{RAILS_ROOT}/app/views/nodes/_attribute.rhtml:11:in `_run_rhtml_nodes__attribute'

----------------------------------------------------------------------------
Here is the code from attribute.rb. Line 403 is the second line below.

 def render_date
    if self.value.empty?
      date = Date.today
    else
      pdate = ParseDate.parsedate(self.value)
      date = Date.new(pdate[0],pdate[1],pdate[2])
    end
    #helpful.select_date date, {:prefix => control_tag_id}
helpful.date_box(control_tag_id, control_tag_css_id, date.to_time.strftime("%m/%d/%Y"))
  end


-----------------------------------------------------------------------------
Regards,
Ezra Wolfe
DLC Solutions
3701 Market Street, Suite 462
Philadelphia, Pa 19104
Mobile: 215.868.5336
Office: 215.966.6177
Fax: 703.935.5594
AIM: ezrawolfe
Skype: ezra.wolfe
www.dlc-solutions.com


_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk

Colin A. Bartlett
Kinetic Web Solutions
http://blog.kineticweb.com



_______________________________________________
To unsubscribe or change your settings, visit:
http://lists.phillyonrails.org/mailman/listinfo/talk