When accessing a page cached action, I encountered the following error:
A Errno::EEXIST occurred in posts#index:
File exists - [...]/public/cache
[...]/fileutils.rb:247:in `mkdir'
This happens when Rails is trying to save the html cache into the public folder.
I was symlinking the cache folder from capistrano’s shared folder. However I forgot to manually create the actual folder under shared/ so Rails tries to recreate the actual folder, only to find the name has already been used by the symlink.
Making sure the symlinked cached folder actually exists stopped this problem.