# Prototype not working with rails 2.2.2?

**URL:** <https://www.ruby-forum.com/t/prototype-not-working-with-rails-2-2-2/196889>\
**Category:** Rails\
**Created:** [January 29, 2009, 11:08am UTC](https://www.ruby-forum.com/t/prototype-not-working-with-rails-2-2-2/196889 "2009-01-29T11:08:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![riky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/94ad74/32.png) [@riky](https://www.ruby-forum.com/u/riky)\
**Post date:** [January 29, 2009, 11:08am UTC](https://www.ruby-forum.com/t/prototype-not-working-with-rails-2-2-2/196889/1 "2009-01-29T11:08:44Z")

</div>

Hi,

i made an application using rails and prototype and all worked fine…  
But today i upgraded rails to 2.2.2 and from that moment when i open  
the webpage with firefox it gives me an error like “object is null”  
and some prototype “helpers” doesn’t work at all as for example the  
observe\_field…

Can anyone help me?

Thanks,  
Riccardo

---

<div class="post-metadata">

**Author:** ![riky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/94ad74/32.png) [@riky](https://www.ruby-forum.com/u/riky)\
**Post date:** [January 29, 2009, 11:12am UTC](https://www.ruby-forum.com/t/prototype-not-working-with-rails-2-2-2/196889/2 "2009-01-29T11:12:17Z")

</div>

On Thu, Jan 29, 2009 at 2:07 AM, riky [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Can anyone help me?
> 
> Thanks,  
> Riccardo

Hi, did you run the following command after installing the gem?

rake rails:update

-Conrad

---

<div class="post-metadata">

**Author:** ![riky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/94ad74/32.png) [@riky](https://www.ruby-forum.com/u/riky)\
**Post date:** [January 29, 2009, 1:29pm UTC](https://www.ruby-forum.com/t/prototype-not-working-with-rails-2-2-2/196889/3 "2009-01-29T13:29:33Z")

</div>

On Thu, Jan 29, 2009 at 2:32 AM, riky [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Firefox gives me an element not found error in prototyoe.js line 3588
> 
> > > But today i upgraded rails to 2.2.2 and from that moment when i open
> > 
> > rake rails:update
> > 
> > -Conrad

Hi, what does the following commands produce?

gem -v

rails -v

-Conrad

---

<div class="post-metadata">

**Author:** ![riky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/94ad74/32.png) [@riky](https://www.ruby-forum.com/u/riky)\
**Post date:** [January 29, 2009, 1:43pm UTC](https://www.ruby-forum.com/t/prototype-not-working-with-rails-2-2-2/196889/4 "2009-01-29T13:43:27Z")

</div>

gem -v  
/usr/bin/gem:11:Warning: Gem::manage\_gems is deprecated and will be  
removed on or after March 2009.  
1.3.1

rails -v  
Rails 2.2.2

---

<div class="post-metadata">

**Author:** ![riky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/94ad74/32.png) [@riky](https://www.ruby-forum.com/u/riky)\
**Post date:** [January 29, 2009, 1:29pm UTC](https://www.ruby-forum.com/t/prototype-not-working-with-rails-2-2-2/196889/5 "2009-01-29T13:29:31Z")

</div>

Hi,

i did :

~/webapps/test/app/views/test$ rake rails:update  
(in /home/citec/webapps/test)

but nothing changes

Firefox gives me an element not found error in prototyoe.js line 3588  
and the observe\_field ajax function is not working

Riccardo

---

<div class="post-metadata">

**Author:** ![riky](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/94ad74/32.png) [@riky](https://www.ruby-forum.com/u/riky)\
**Post date:** [January 29, 2009, 1:59pm UTC](https://www.ruby-forum.com/t/prototype-not-working-with-rails-2-2-2/196889/6 "2009-01-29T13:59:03Z")

</div>

My code was

TEST

CIAO
  
\<%= select\_tag 'direction[]', options\_for\_select (@directions), :multiple =\> false,:class=\>'list'%\>

\<%= observe\_field ‘direction[]’, :url =\> { :action  
=\> :observe\_field\_test },:frequency =\> 0.25,:update =\> :text,:with =\>  
‘direction[]’ %\>

now trying to change it to

TEST

CIAO
  
\<%= select\_tag 'direction', options\_for\_select(@directions), :multiple =\> false,:class=\>'list'%\>

\<%= observe\_field ‘direction’, :url =\> { :action  
=\> :observe\_field\_test },:frequency =\> 0.25,:update =\> :text,:with =\>  
‘direction’ %\>

seems to work…

but i don’t understand why…
