Install the following ubuntu packages first

sudo apt-get install imagemagick libmagickwand-dev

running
ubuntu 14.04
rvm 1.26.11
ruby 2.2.3