Rails 2.3.3 upgrade shows error

You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<

any ideas ?
Application works fine with rails 2.1.0

Sandip


Ruby on Rails Developer

http://brandpotion.com (Latest project released)

2009/9/29 Sandip R. [email protected]:

You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<

any ideas ?

No, none at all without showing us some code and the error, we are not
telepathic, unless you forgot to do rake rails:update when changing
the version, in which case perhaps I am wrong (about the telepathy).

Colin

@colin

yes … i did " rake rails:update "

–Sandip

One more thing…
This error appears on page where form_tag / form_for got used…

Otherewise, Else works fine !

–Sandip

2009/9/29 Sandip R. [email protected]:

One more thing…
This error appears on page where form_tag / form_for got used…

Otherewise, Else works fine !

As I said we are not telepathic, you must show us some code and the
error.

Colin

Why don’t you create a dummy rails project on 2.3.x and copy your code
over? It isn’t as elegant as using the rake task, but it will
work. You will need to rename application.rb to
application_controller.rb, but the rest should be more or less
straightforward.

@mukund

sounds good…but little tedy task.

@colin

/views/sessions/new.html.erb
<% form_tag( session_path, :builder => DavesFormBuilder ) do %>

Login

<%= text_field_tag ‘login’ %>


Password

<%= password_field_tag ‘password’ %>
<%= submit_tag ‘login’%>
<% end %>

url => http://localhost:3000/session/new

–Sandip

2009/9/29 Sandip R. [email protected]:

    Â

Password

     <%= password_field_tag ‘password’ %>
     <%= submit_tag ‘login’%>
<% end %>

Nearly there, and the error is? on which line? with the trace.

Colin

Hi Colin

On Tue, Sep 29, 2009 at 3:56 PM, Colin L. [email protected]
wrote:

  <p><label for="login">Login</label><br/>
  <%= text_field_tag 'login' %></p>
  <p><label for="password">Password</label><br/>
  <%= password_field_tag 'password' %>
  <%= submit_tag 'login'%>

<% end %>

Nearly there, and the error is? on which line? with the trace.

Error trace is as follows

You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<

Extracted source (around line #7):
4:

Sign into System


5:
6:

7: <% form_tag( session_path, :builder => DavesFormBuilder ) do %>
8:

Login

9: <%= text_field_tag ‘login’ %>


10:

Password

Application trace
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/action_view/helpers/text_helper.rb:32:in
concat' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/action_view/helpers/form_tag_helper.rb:467:in form_tag_in_block’
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/action_view/helpers/form_tag_helper.rb:39:in
form_tag' /home/demo/ace-trunk/app/views/sessions/new.html.erb:7:in _run_erb_app47views47sessions47new46html46erb’

Sandip


Ruby on Rails Developer

http://brandpotion.com (Latest project released)

2009/9/29 Sandip R. [email protected]:

4:

Sign into System


5:
6:

7: <% form_tag( session_path, :builder => DavesFormBuilder ) do %>

Can you use :builder with form_tag? I would try it without the
builder and see if that is the problem.

Colin

@colin

I figured out problem. I just comment out erubies in environment.rb and
everything working fine.

I am wondering that where erubies got incompatibility in this version.

–Sandip

On Tue, Sep 29, 2009 at 6:07 PM, Colin L. [email protected]
wrote:

sounds good…but little tedy task.
<% end %>

Colin
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.3/lib/action_view/helpers/form_tag_helper.rb:467:in


Ruby on Rails Developer

http://brandpotion.com (Latest project released)