Bastien
Bastien

Reputation: 481

Installing older version of imagemagick with homebrew

I need to install an older version of imagemagick (6.5.9-3), I can see it in the list of available versions

> brew versions
6.6.1-5  git checkout 1c9f04e Library/Formula/imagemagick.rb
6.5.9-8  git checkout 685dbff Library/Formula/imagemagick.rb
6.5.9-3  git checkout 258720c Library/Formula/imagemagick.rb
6.5.6-5  git checkout 7c90d02 Library/Formula/imagemagick.rb
6.5.5-10 git checkout b01c13d Library/Formula/imagemagick.rb

but when I checkout that version with

> git checkout 258720c Library/Formula/imagemagick.rb

and then run

> brew install imagemagick

I get an error saying that

Error: imagemagick is a head-only formula
Install with `brew install --HEAD imagemagick

Why is brew listing those versions if it can't install them? So the question remains, how to install an older version of imagemagick with brew?

(This solution is not working any longer: Cannot install older version of ImageMagick via Homebrew)

Thanks in advance for your help.

Upvotes: 6

Views: 9199

Answers (2)

0x4a6f4672
0x4a6f4672

Reputation: 28245

You can define your own Homebrew formula in a GitHub Gist and install it with

brew install path/to/your/GistToYourPersonalImageMagickFormula

for example here or here

Upvotes: 2

Andrew Janke
Andrew Janke

Reputation: 23898

If it's for Ruby 1.8.6 compatibility, or any 6.5.9-x version will do, there is an ImageMagick 6.5.9.x formula provided as imagemagick-ruby186 in the homebrew-versions tap. This will be easiest, and will be supported by future updates.

brew tap homebrew/versions
brew install imagemagick-ruby186

Those 6.5.9.x versions of the original imagemagick formula are so old that they may have compatibility problems with the current brew ruby scripts. (They currently give "Formulae require at least a URL" errors; your error was probably a similar issue.) To get those to install, you'll probably have to roll back all of Homebrew to that point in time before doing the build, with a git checkout on the entire repo, not just the one file.

That other answer you linked will fail for the same reason - it's another mechanism of doing the same thing, just acquiring the old version of the imagemagick.rb formula via the web instead of through git, so it'll have the same compatibility problems.

Upvotes: 1

Related Questions