fragment caching file_store problems

I'm having problems on both my production and development servers with
fragment caching.

Every time I try to cache something using <% cache do %>, I get the
following error:
Couldn't create cache directory: views/
174 (wrong number of arguments (2 for 1))
but strangely, all of the directories apart from the last one are
created. Adding path components to generate a key makes no difference.

I have no idea how to debug this, and have googled to no avail. I
don't have any caching plugins installed.

  config.action_controller.cache_store = :file_store, "#{RAILS_ROOT}/
and I have perform_caching set to true in both dev and production and
I set my cache directory to 777, all to no avail.

About your application's environment
Ruby version 1.8.7 (i686-darwin9.3.0)
RubyGems version 1.3.3
Rails version 2.2.2
Active Record version 2.2.2
Action Pack version 2.2.2
Active Resource version 2.2.2
Action Mailer version 2.2.2
Active Support version 2.2.2

Does anyone have any idea what this could be?
Any advice most gratefully received.

I've managed to make this work by changing the following lines in

+ File.atomic_write(real_file_path(name), cache_path) { |f| f.write
(Marshal.dump(value)) }
- File.atomic_write(real_file_path(name), cache_path) { |f|
Marshal.dump(value, f) }

as far as I can see, it's doing the same thing, but for some reason
Marshal won't treat f as an IOstream as I think it's supposed to.
I don't really like changing it there though, and I'd like to know why
it doesn't work as it's supposed to.

any thoughts still welcome