RMagick install problem

This works:

sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev

according to dalibor-filus's comment below.

[Original answer - Okay I seem to have solved this with apt-get install imagemagick libmagickwand-dev, so libmagick9-dev wasn't necessary.]