Ruby On Rails : Installing RMagick on Ubuntu at once along with dependencies

What is RMagick?

RMagick is a binding from Ruby to the ImageMagick TM image manipulation library. Here’s how the ImageMagick home page describes ImageMagick:

ImageMagickTM… is a free software suite to create, edit, and compose bitmap images. It can read, convert and write images in a large variety of formats. Images can be cropped, colors can be changed, various effects can be applied, images can be rotated and combined, and text, lines, polygons, ellipses and BĂ©zier curves can be added to images and stretched and rotated.

ImageMagick offers a full range of image processing tools that provide the capability to:

  • Convert an image from one format to another (e.g. TIFF to JPEG)
  • Resize, rotate, sharpen, color reduce, or add special effects to an image
  • Create a montage of image thumbnails
  • Create a transparent image suitable for use on the Web
  • Turn a group of images into a GIF animation sequence
  • Create a composite image by combining several separate images
  • Draw shapes or text on an image
  • Decorate an image with a border or frame
  • Describe the format and characteristics of an image

Steps:

Installing dependencies

Aptitude is an Ncurses based FrontEnd to Apt, the debian package manager. Since it is text based, it is run from a terminal or a CLI (command line interface). Aptitude has a number of useful features,

$ sudo apt-get install aptitude
$ sudo aptitude install graphicsmagick-libmagick-dev-compat

or simply using `apt-get`

$ sudo apt-get install graphicsmagick-libmagick-dev-compat

Installing rMagick

  1. $ sudo apt-get install imagemagick
  2. $ sudo apt-get install libmagickcore-dev
  3. $ sudo apt-get install libmagickwand-dev
  4. $ gem install rmagick

Note: not done? —> Did you try restarting the terminal?

Simple Idea

create a something.sh file and save the following code

sudo apt-get install aptitude
sudo aptitude install graphicsmagick-libmagick-dev-compat
sudo apt-get install imagemagick
sudo apt-get install libmagickcore-dev
sudo apt-get install libmagickwand-dev
gem install rmagick

Then to execute, use `sh` is command that executes `shellcommand` files

$ sudo sh something.sh

This will install all the dependencies and the page at once. However, it may ask you to confirm some decisions frequently.

If any problem occur regarding installation of dependency packages then

$ apt-get update

and try again installing the packages

Source:

http://blog.dwaynecrooks.com/post/83608020279/installing-rmagick-on-ubuntu-14-04-lts

http://www.imagemagick.org/RMagick/doc/

http://stackoverflow.com/questions/3894225/imagemagick-rmagick-cant-install-rmagick-2-13-1-cant-find-magick-config

https://wiki.debian.org/Aptitude

2 thoughts on “Ruby On Rails : Installing RMagick on Ubuntu at once along with dependencies

  1. Prakash says:

    sudo apt-get install libmagickcore-dev
    was the necessary command before sudo apt-get install libmagickwand-dev
    rest, it worked awesome, thank you for this great tutorial🙂

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s