It may happens that the CD-ROM tray of your Macbook is blocked and that you're unable to unlock it (using the Eject button). Here's a simple command that may help out out.
- Open a terminal
sudo drutil eject
- Press the Enter key
- Give your password when it is requested.
This document, titled « MacOS - Eject CD-Rom using a command line », is available under the Creative Commons
license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM