In Ubuntu, sometimes a process will tie up the CD drive and you will be unable to eject it. Thankfully there is an easy way to get around this. At the command line, enter:
# fuser /media/cdrom
to figure out which process is using the drive then:
# sudo fuser -k /media/cdrom
and just enter your pass-phrase to unlock it then:
to eject the disc. Congratulations! That's all there is to it!