Rails Write file issue - Build Fails

Hello,
I am running into issues build an application on a CircleCI VM. This is a rails application. There is a suite of spec tests that get run and one is failing because it needs to create folders and write a file. and it writes a file to home/circleci/project/public/, however it fails because it cannot write the file.

I know this because i can SSH into the failed server and run a rails console and check the rails DB

So basically, how do i get the rails application permission to write and make folders/subfolders and a file?

It will be difficult to edit the existing code, and would be better if we can take care of the permissions from the config.yml file.

Thanks,
Mat

You should be able to mkdir and chmod the needed directory as a step before your command runs.