# "the number of parameters does not match the number of subst

**URL:** <https://www.ruby-forum.com/t/the-number-of-parameters-does-not-match-the-number-of-subst/96850>\
**Category:** Rails\
**Created:** [July 2, 2006, 5:09pm UTC](https://www.ruby-forum.com/t/the-number-of-parameters-does-not-match-the-number-of-subst/96850 "2006-07-02T17:09:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 2, 2006, 5:09pm UTC](https://www.ruby-forum.com/t/the-number-of-parameters-does-not-match-the-number-of-subst/96850/1 "2006-07-02T17:09:46Z")

</div>

All of a sudden, I’m getting this error:

1. Error:  
test\_index(AccountControllerTest):  
RuntimeError: The number of parameters does not match the number of  
substitutions.  
/home/joe/projects/tanga/trunk/config/…/vendor/rails/actionpack/lib/action\_controller/assertions.rb:92:in  
`assert_redirected_to' /home/joe/projects/tanga/trunk/config/../vendor/rails/actionpack/lib/action_controller/assertions.rb:313:in`clean\_backtrace’  
/home/joe/projects/tanga/trunk/config/…/vendor/rails/actionpack/lib/action\_controller/assertions.rb:74:in  
`assert_redirected_to' ./test/functional/account_controller_test.rb:16:in`test\_index’

I thought it happened when I upgraded to Rails 1.1.4, but it happens  
now when I downgrade to 1.1.2.

Here’s test/functional/account\_controller\_test.rb:  
class AccountControllerTest \< Test::Unit::TestCase  
def setup  
@controller = AccountController.new  
@request = ActionController::TestRequest.new  
@response = ActionController::TestResponse.new  
end

def test\_index  
get :index  
assert\_redirected\_to :action =\> ‘login’ # LINE 16  
end

def test\_login  
get :login  
assert\_valid\_markup  
end  
end

Any ideas?

Thanks,  
Joe

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 3, 2006, 6:25pm UTC](https://www.ruby-forum.com/t/the-number-of-parameters-does-not-match-the-number-of-subst/96850/2 "2006-07-03T18:25:27Z")

</div>

On 7/2/06, Joe Van D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> /home/joe/projects/tanga/trunk/config/../vendor/rails/actionpack/lib/action_controller/assertions.rb:74:in
> @controller = AccountController.new
> get :login
> assert_valid_markup
> 
> ```
> 
> end  
> end

Anyone?

Rails is not being nice to me at the moment. On another machine,  
running Ubuntu Dapper, I’m getting:

/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require': no such file to load -- test/rails (MissingSourceFile) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’  
from  
/home/joe/projects/tanga/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:147:in  
`require' from ./test/functional/../test_helper.rb:4 from ./test/functional/account_controller_test.rb:1 from /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5 from /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5 /usr/local/bin/ruby -Ilib:test "/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb" "test/integration/layout_test.rb" /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem\_original\_require’: no such file to load – test/rails  
(MissingSourceFile)  
from  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' from /home/joe/projects/tanga/config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/dependencies.rb:147:in `require’  
from ./test/integration/…/test\_helper.rb:4  
from ./test/integration/layout\_test.rb:1  
from  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader.rb:5  
from  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader.rb:5  
rake aborted!

When I run my unit tests. I’ve installed Ruby 1.8.4 into /usr/local.  
I’ve got a copy of Rails 1.1.4 in vendor/rails.

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 3, 2006, 6:25pm UTC](https://www.ruby-forum.com/t/the-number-of-parameters-does-not-match-the-number-of-subst/96850/3 "2006-07-03T18:25:39Z")

</div>

On 7/3/06, Joe Van D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > `clean\_backtrace’  
> > def setup  
> > def test\_login  
> > /usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
> > /usr/local/bin/ruby -Ilib:test  
> > from ./test/integration/layout\_test.rb:1  
> > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader.rb:5  
> > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake\_test\_loader.rb:5  
> > rake aborted!
> 
> When I run my unit tests. I’ve installed Ruby 1.8.4 into /usr/local.  
> I’ve got a copy of Rails 1.1.4 in vendor/rails.

And rubygems 0.9 installed.

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 3, 2006, 7:14pm UTC](https://www.ruby-forum.com/t/the-number-of-parameters-does-not-match-the-number-of-subst/96850/4 "2006-07-03T19:14:44Z")

</div>

On 7/3/06, Joe Van D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > ```
> > > /home/joe/projects/tanga/trunk/config/../vendor/rails/actionpack/lib/action_controller/assertions.rb:313:in
> > > 
> > > ```
> > > 
> > > class AccountControllerTest \< Test::Unit::TestCase
> > 
> > ```
> > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5
> > from ./test/integration/../test_helper.rb:4
> > from ./test/integration/layout_test.rb:1
> > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5
> > from /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5
> > 
> > ```
> > 
> > rake aborted!
> > 
> > When I run my unit tests. I’ve installed Ruby 1.8.4 into /usr/local.  
> > I’ve got a copy of Rails 1.1.4 in vendor/rails.
> 
> And rubygems 0.9 installed.

I am having zero luck with anything.

Migrations (using postgres) don’t work:

joe@desktop:~/projects/tanga$ rake migrate --trace  
(in /home/joe/projects/tanga)  
\*\* Invoke migrate (first\_time)  
\*\* Invoke db:migrate (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:migrate  
rake aborted!  
No such file or directory - /tmp/.s.PGSQL.5432  
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/connection.rb:140:in  
`initialize' /usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/connection.rb:140:in `establish\_connection’  
/usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/connection.rb:25:in  
`initialize' /usr/local/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/postgres-compat.rb:23:in `initialize’  
/home/joe/projects/tanga/config/…/vendor/rails/activerecord/lib/active\_record/connection\_adapters/postgresql\_adapter.rb:24:in  
`postgresql_connection' /home/joe/projects/tanga/config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:251:in `connection\_without\_query\_cache=’  
/home/joe/projects/tanga/config/…/vendor/rails/activerecord/lib/active\_record/query\_cache.rb:54:in  
`connection=' /home/joe/projects/tanga/config/../vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in `retrieve\_connection’  
/home/joe/projects/tanga/config/…/vendor/rails/activerecord/lib/active\_record/connection\_adapters/abstract/connection\_specification.rb:78:in  
`connection' /home/joe/projects/tanga/config/../vendor/rails/activerecord/lib/active_record/migration.rb:281:in `migrate’  
/home/joe/projects/tanga/config/…/vendor/rails/railties/lib/tasks/databases.rake:4  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in  
`execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:364:in `invoke\_prerequisites’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:999:in `each' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in `invoke\_prerequisites’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:356:in `invoke' /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run’  
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7  
/usr/local/bin/rake:18

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 3, 2006, 9:21pm UTC](https://www.ruby-forum.com/t/the-number-of-parameters-does-not-match-the-number-of-subst/96850/5 "2006-07-03T21:21:07Z")

</div>

On 7/3/06, Joe Van D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > > ```
> > > > > /home/joe/projects/tanga/trunk/config/../vendor/rails/actionpack/lib/action_controller/assertions.rb:92:in
> > > > > 
> > > > > assert_redirected_to :action => 'login' # LINE 16
> > > > > 
> > > > > ```
> > > > 
> > > > Rails is not being nice to me at the moment. On another machine,  
> > > > from ./test/functional/account\_controller\_test.rb:1  
> > > > from /home/joe/projects/tanga/config/…/vendor/rails/activerecord/lib/…/…/activesupport/lib/active\_support/dependencies.rb:147:in  
> > > > And rubygems 0.9 installed.  
> > > > \*\* Execute environment  
> > > > `initialize’  
> > > > /home/joe/projects/tanga/config/…/vendor/rails/activerecord/lib/active\_record/migration.rb:281:in  
> > > > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in  
> > > > gem, rubygems couldn’t find it.  
> > > > Whew, fixed. First problem was that I didn’t install the zentest gem.  
> > > > I had a line in test\_helper.rb that was requiring a file from it.

The second issue was fixed by manually installing the ruby-postgres  
binding. For some reason, the gem didn’t work.

Joe

---

<div class="post-metadata">

**Author:** ![joe-dumoulin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Post date:** [July 3, 2006, 7:17pm UTC](https://www.ruby-forum.com/t/the-number-of-parameters-does-not-match-the-number-of-subst/96850/6 "2006-07-03T19:17:55Z")

</div>

On 7/3/06, Joe Van D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > `assert_redirected_to' Here's test/functional/account_controller_test.rb: end running Ubuntu Dapper, I'm getting: from /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/rake_test_loader.rb:5 `require’
> 
> \*\* Execute db:migrate  
> /home/joe/projects/tanga/config/…/vendor/rails/activerecord/lib/active\_record/connection\_adapters/postgresql\_adapter.rb:24:in  
> `migrate' `invoke\_prerequisites’  
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:356:in `invoke' /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize’  
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run’  
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run’  
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7  
> /usr/local/bin/rake:18

And I’m using postgres-pr because even after I installed the postgres  
gem, rubygems couldn’t find it.
