Loop over directories array, working to solve bundle install issue with nginx agent