- Introduction
- Prerequisites
- Installing RMagick
- Using RMagick
- Things that can go wrong
- Upgrading
- More samples
- Reporting Bugs
- Development Setup
- Credits
- License
- Releasing
RMagick is an interface between the Ruby programming language and the ImageMagick image processing library.
These prerequisites are required for the latest version of RMagick.
OS
- Linux
- *BSD
- macOS
- Windows
- Other *nix-like systems
C++ compiler
- RMagick 5.4.0 or later requires a C++ compiler.
Ruby
- Version 3.0 or later.
You can get Ruby from https://www.ruby-lang.org.
Ruby must be able to build C-Extensions (e.g. MRI, Rubinius, not JRuby)
ImageMagick
- Version 6.8.9 or later (6.x.x).
- Version 7.0.8 or later (7.x.x). Require RMagick 4.1.0 or later.
You can get ImageMagick from https://imagemagick.org.
On Ubuntu, you can run:
sudo apt-get install libmagickwand-devOn Centos, you can run:
sudo yum install ImageMagick-develOn Arch Linux, you can run:
pacman -Syy imagemagickOn Alpine Linux, you can run:
apk add imagemagick imagemagick-dev imagemagick-libs
or you can run if you would like to use ImageMagick 6:
apk add imagemagick6 imagemagick6-dev imagemagick6-libs
On macOS, you can run:
brew install imagemagickor you can run if you would like to use ImageMagick 6:
brew install imagemagick@6- Install latest Ruby+Devkit package which you can get from RubyInstaller for Windows.
- Download
ImageMagick-7.XXXX-Q16-x64-dll.exe(not,ImageMagick-7.XXXX-Q16-x64-static.exe) binary from Windows Binary Release, or you can download ImageMagick 6 from Windows Binary Release. - Install ImageMagick. You need to turn on checkboxes
Add application directory to your system pathandInstall development headers for C and C++in an installer for RMagick.
If you want to install ImageMagick using winget, run the following command:
winget install ImageMagick.ImageMagick --custom /TASKS=modifypath,install_DevelIf you want to install ImageMagick using Chocolatey, run the following command:
choco install imagemagick -PackageParameters InstallDevelopmentHeaders=trueNote
When you update the ImageMagick version, we have recommended you should re-install RMagick.
Add to your Gemfile:
gem 'rmagick'Then run:
bundle installFor Windows, you need to run using ridk tool:
ridk exec bundle installRun:
gem install rmagickFor Windows, you need to run using ridk tool:
ridk exec gem install rmagickRMagick is versioned according to Semantic Versioning. For stable version
compatible with Ruby 3.0+, use ~> 3.0. Versions >= 6 work on Ruby >= 3.x
only.
Require RMagick in your project as follows:
require 'rmagick'See https://rmagick.github.io/usage.html for links to more information.
The RMagick installation FAQ has answers to the most commonly reported problems, though may be out of date.
Can't install RMagick. Can't find libMagickCore-XXXX.so or one of the dependent libraries. Check the mkmf.log file for more detailed information
Typically this message means that one or more of the libraries that ImageMagick depends on hasn't been installed. Examine the mkmf.log file in the ext/RMagick subdirectory of the installation directory for any error messages. These messages typically contain enough additional information for you to be able to diagnose the problem. Also see this FAQ.
If you get a message like this:
... /core_ext/kernel_require.rb>:136:in `require': cannot load such file -- RMagick2.so (LoadError)
(snip)you probably do not have the directory in which the ImageMagick library
is installed in your load path. An easy way to fix this is to define
the directory in the LD_LIBRARY_PATH environment variable. For
example, suppose you installed the ImageMagick library libMagickCore-XXXX.so in
/usr/local/lib. (By default this is where it is installed.) Create the
LD_LIBRARY_PATH variable like this:
export LD_LIBRARY_PATH=/usr/local/libOn Linux, see ld(1) and ld.so(8) for more information. On other operating
systems, see the documentation for the dynamic loading facility.
This operation might not be required when you can use 4.2.5 or later.
Default stack size of your operating system might be too small. Try removing the limit with this command:
ulimit -s unlimitedIf you upgrade to a newer release of ImageMagick, make sure you're using a release of RMagick that supports that release. It's safe to install a new release of RMagick over an earlier release.
You can find more sample RMagick programs in the /examples and /doc/ex directories. These programs are not installed in the RMagick documentation tree.
Please report bugs in RMagick, its documentation, or its installation programs via the bug tracker on the RMagick issues page.
However, We can't help with Ruby installation and configuration or ImageMagick installation and configuration. Information about reporting problems and getting help for ImageMagick is available at the ImageMagick website or the ImageMagick Forum.
In order to minimize issues on your local machine, we recommend that you make use of a Vagrant installation.
Steps to get up and running with a passing build are as follows:
If you don't already have Vagrant installed, you can download and install it from here. Once installed, we can set up a pre-built environment:
git clone https://github.com/tjschuck/rake-compiler-dev-box.git
cd rake-compiler-dev-box
vagrant upThis last part will probably take a while as it has to download an Ubuntu image and configure it. If there is an error during this process, you may need to reboot your computer and enable virtualization in your BIOS settings.
Within the rake-compiler-dev-box directory:
git clone https://github.com/rmagick/rmagick.git # or your fork
vagrant sshcd /vagrant/rmagick
export IMAGEMAGICK_VERSION=6.8.9-10
bash ./before_install_linux.shThis will take just a few minutes to build ImageMagick
rakeThis compiles the RMagick extensions and runs the tests. If all goes well you'll see a lot of output, eventually ending in something like:
Finished tests in 35.865734s, 11.3758 tests/s, 6560.3007 assertions/s.
408 tests, 235290 assertions, 0 failures, 0 errors, 0 skipsAnd you're all set! The copy of RMagick within /vagrant/rmagick inside your
Vagrant session is the same as the one in the rake-compiler-dev-box directory
on your machine. You can make changes locally and run tests within your ssh
session.
Authors: Tim Hunter, Omer Bar-or, Benjamin Thomas
Thanks to ImageMagick Studio LLC for ImageMagick and for hosting the RMagick documentation.
See https://github.com/rmagick/rmagick/wiki/Release-Process
- Update ChangeLog
- Edit
lib/rmagick/version.rb - Are the tests passing? Run
rakeagain just to be sure. rake release