---
id: mac-storage-basics.how-do-i-clean-ruby-gems-and-composer-caches
url: https://storagestudio.us/faq/mac-storage-basics/how-do-i-clean-ruby-gems-and-composer-caches
category: "Mac storage basics"
subcategory: "Programming languages and toolchains"
question: "How do I clean up old Ruby gems and PHP Composer caches?"
alt_questions:
  - "gem cleanup mac"
  - "old ruby gems space"
  - "composer clear-cache"
  - "composer cache size mac"
  - "bundler gems disk space"
  - "php composer cache location"
short_answer: "Run gem cleanup to remove old gem versions and composer clear-cache to empty Composer's download cache. Project vendor folders can be deleted and reinstalled."
tags: ["ruby", "php", "developer"]
related: ["https://storagestudio.us/faq/mac-storage-basics/how-do-i-clean-npm-yarn-and-pip-caches", "https://storagestudio.us/faq/mac-storage-basics/how-do-i-remove-old-node-python-or-ruby-versions"]
applies_to: "all"
last_reviewed: 2026-10-01
---

# How do I clean up old Ruby gems and PHP Composer caches?

Both keep old versions and downloads around:

- **Ruby**: `gem cleanup` removes older versions of installed gems, keeping the newest. Project-specific gems installed by Bundler into a project folder can be deleted with the project's `vendor/bundle` folder and reinstalled later.
- **PHP**: `composer clear-cache` empties Composer's download cache. Each project's `vendor` folder can be deleted and restored with `composer install`.

Run them from Terminal; neither touches your source code.
