# Rails 2 problem with compute\_public\_path

**URL:** <https://www.ruby-forum.com/t/rails-2-problem-with-compute-public-path/121805>\
**Category:** Rails\
**Created:** [December 1, 2007, 2:41am UTC](https://www.ruby-forum.com/t/rails-2-problem-with-compute-public-path/121805 "2007-12-01T02:41:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [December 1, 2007, 2:41am UTC](https://www.ruby-forum.com/t/rails-2-problem-with-compute-public-path/121805/1 "2007-12-01T02:41:22Z")

</div>

I’m trying to migrate to Rails 2, but keep getting these errors all  
over the place:

ActionView::TemplateError: wrong number of arguments (2 for 3)  
On line #61 of users/new.rhtml

```
58: <% if @captcha_error -%><div class="fieldWithErrors"><

```

% end -%\>  
59:

  
60:   
61:   
63:   
64: 

```
vendor/rails/actionpack/lib/action_view/helpers/

```

asset\_tag\_helper.rb:350:in `compute_public_path' vendor/rails/actionpack/lib/action_view/helpers/ asset_tag_helper.rb:350:in`path\_to\_image’  
vendor/rails/actionpack/lib/action\_view/helpers/  
asset\_tag\_helper.rb:390:in `image_tag' app/views/users/new.rhtml:61:in`\_run\_rhtml\_47app47views47users47new46rhtml’  
vendor/rails/actionpack/lib/action\_view/helpers/form\_helper.rb:  
224:in `fields_for' vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb: 184:in`form\_for’  
…

Basically, every function that calls `compute\_public\_path’ gets this  
error. In this case, it’s ‘image\_tag’.  
I’m looking at the source and don’t see any problem.

```
  def image_path(source)
    compute_public_path(source, 'images')
  end

  def compute_public_path(source, dir, ext = nil, include_host =

```

true)

compute\_public\_path takes a minimus of one parameter, which is  
supplied by image\_path.

What am I doing wrong here?

Thanks,  
Helzer

| Verification  
code:  
 | \<%= image\_tag  
@captcha\_image.public\_filename, :size=\>@captcha\_image.image\_size %\>\</  
td\>  
62: |
| Enter code: | \<%= text\_field\_tag :code %\> |

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [December 1, 2007, 3:14am UTC](https://www.ruby-forum.com/t/rails-2-problem-with-compute-public-path/121805/2 "2007-12-01T03:14:06Z")

</div>

On 11/30/07, helzer [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m trying to migrate to Rails 2, but keep getting these errors all  
> over the place:
> 
> ActionView::TemplateError: wrong number of arguments (2 for 3)

You probably have a plugin, like asset\_packager, overriding tag\_options.

jeremy

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [December 1, 2007, 3:14am UTC](https://www.ruby-forum.com/t/rails-2-problem-with-compute-public-path/121805/3 "2007-12-01T03:14:06Z")

</div>

On 11/30/07, Jeremy K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 11/30/07, helzer [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I’m trying to migrate to Rails 2, but keep getting these errors all  
> > over the place:
> > 
> > ActionView::TemplateError: wrong number of arguments (2 for 3)
> 
> You probably have a plugin, like asset\_packager, overriding tag\_options.

Or image\_path…

jeremy

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [December 1, 2007, 3:39am UTC](https://www.ruby-forum.com/t/rails-2-problem-with-compute-public-path/121805/4 "2007-12-01T03:39:14Z")

</div>

Nice catch Jeremy,

I’ll patch asset\_packager for Rails 2.

Amir
