Adding Image to your Rails App using Active storage in Rails 6
While building the blog, we need to implement our image processing with rails own active storage. In order to do so, we need to have the dependency on imagemagic installed on your system. The system i am using is ubuntu linux, on codeanywhere envrionment. So this tutorial is based on linux based environment.
We will need to install the latest ImageMagick 7 on Ubuntu 18.04 Linux from source code. Firstly, we will install all compilation dependencies, followed by ImageMagick’s source code compilation and subsequent installation.
Open your terminal and enter:
sudo apt update
sudo apt build-dep imagemagick
Lets download and extract image magic using the wget command.
tar xf ImageMagick.tar.gz
While still in the ImageMagick’s source code directory execute the
configure command to perform a compilation configuration and to make sure that all compilation dependencies are met:
./configureThen execute $ make
Lastly, install ImageMagick by executing:
sudo make install
ldconfig to link static libraries:
sudo ldconfig /usr/local/lib
Hope this helps. Once you have imagemajic on your system we should be able to continue with active storage setup.