When I try to install rmagic with:
gem install rmagic
it gives error:
Building native extensions. This could take a while... E
Here is the good example on this blog
The below command will solve your problem. It helped me to install rmagick.
sudo apt-get install libdjvulibre-dev libjpeg-dev libtiff-dev libwmf-dev libmagickcore-dev libmagickwand-dev libmagick++-dev