Forum: Ruby on Rails Tracking down rake error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ryan W. (Guest)
on 2007-02-07 06:48
(Received via mailing list)
I've created a Rails project for playing around with something, and
I've made a single controller with two actions in it.  The tiny app
runs fine, but I decided to try doing a functional test and see what I
got.  But 'rake test' fails with a not-very-useful error, and I don't
know where to go to track it down.  Google is as confused as I am. :)
Here's what I get when I run rake:

Ryans-MacBook:~/dev/play rew$ rake -v test:functionals
(in /Users/rew/dev/play)
[some stuff deleted for space]
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
** Execute test:functionals
rake aborted!
wrong number of arguments (3 for 2)
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:725:in
`fu_check_options'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:725:in `sh'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:812:in `sh'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:747:in `ruby'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:812:in `ruby'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/testtask.rb:117:in
`define'
[some stuff deleted for space]

Now, if I run the test directly, it seems to work:

Ryans-MacBook:~/dev/play rew$ ruby
test/functional/welcome_controller_test.rb
Loaded suite test/functional/welcome_controller_test
Started
.
Finished in 0.02188 seconds.

1 tests, 1 assertions, 0 failures, 0 errors

So how can I track down what's gone busted with my 'rake test' stuff?
Any pointers?

script/about says:

Ryans-MacBook:~/dev/play rew$ script/about
About your application's environment
Ruby version                 1.8.5 (i686-darwin8.8.2)
RubyGems version             0.9.2
Rails version                1.2.1
Active Record version        1.15.1
Action Pack version          1.13.1
Action Web Service version   1.2.1
Action Mailer version        1.3.1
Active Support version       1.4.0
Application root             /Users/rew/dev/play
Environment                  development
Database adapter             mysql
Rohan K. (Guest)
on 2007-02-09 06:52
had the same issue

open the file - /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb
and just change line 726 from

    fu_check_options options, :noop, :verbose


to

    fu_check_options options, [:noop, :verbose]


read more about this at
http://rubyforge.org/pipermail/char-encodings-deve...
http://jarp.does.notwork.org/diary/200610c.html

Had the same issues on my machine. Just fixed it.

rgds
ROhan

Ryan W. wrote:
> I've created a Rails project for playing around with something, and
> I've made a single controller with two actions in it.  The tiny app
> runs fine, but I decided to try doing a functional test and see what I
> got.  But 'rake test' fails with a not-very-useful error, and I don't
> know where to go to track it down.  Google is as confused as I am. :)
> Here's what I get when I run rake:
>
> Ryans-MacBook:~/dev/play rew$ rake -v test:functionals
> (in /Users/rew/dev/play)
> [some stuff deleted for space]
> ** Invoke db:schema:load (first_time)
> ** Invoke environment
> ** Execute db:schema:load
> ** Execute test:functionals
> rake aborted!
> wrong number of arguments (3 for 2)
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:725:in
> `fu_check_options'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:725:in `sh'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:812:in `sh'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:747:in `ruby'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:812:in `ruby'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake/testtask.rb:117:in
> `define'
> [some stuff deleted for space]
>
> Now, if I run the test directly, it seems to work:
>
> Ryans-MacBook:~/dev/play rew$ ruby
> test/functional/welcome_controller_test.rb
> Loaded suite test/functional/welcome_controller_test
> Started
> .
> Finished in 0.02188 seconds.
>
> 1 tests, 1 assertions, 0 failures, 0 errors
>
> So how can I track down what's gone busted with my 'rake test' stuff?
> Any pointers?
>
> script/about says:
>
> Ryans-MacBook:~/dev/play rew$ script/about
> About your application's environment
> Ruby version                 1.8.5 (i686-darwin8.8.2)
> RubyGems version             0.9.2
> Rails version                1.2.1
> Active Record version        1.15.1
> Action Pack version          1.13.1
> Action Web Service version   1.2.1
> Action Mailer version        1.3.1
> Active Support version       1.4.0
> Application root             /Users/rew/dev/play
> Environment                  development
> Database adapter             mysql
This topic is locked and can not be replied to.