Teamcity is now started as a foreground process as opposed to a headless service as recommended at https://confluence.jetbrains.com/display/TCD8/Known+Issues. Also stopped using a separate ruby for the frontend tests, we are now using only the ruby bundled with chef.