1

I'm getting a very weird answer when I'm trying to install ImageMagick through Homebrew.

It's giving me this:

Holger-Sindbaeks-MacBook-Air:showwwdown_0.3 holgersindbaek$ brew install imagemagick

Error: undefined method `=~' for #<Pathname:/usr/local/Library/Formula/jpeg.rb>
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
/usr/local/Library/Homebrew/formula.rb:426:in `factory'
/usr/local/Library/Homebrew/formula_installer.rb:38:in `block (2 levels) in install'
/usr/local/Library/Homebrew/extend/ARGV.rb:121:in `filter_for_dependencies'
/usr/local/Library/Homebrew/formula_installer.rb:34:in `block in install'
/usr/local/Library/Homebrew/formula_installer.rb:30:in `each'
/usr/local/Library/Homebrew/formula_installer.rb:30:in `install'
/usr/local/Library/Homebrew/cmd/install.rb:103:in `block in install_formulae'
/usr/local/Library/Homebrew/cmd/install.rb:86:in `each'
/usr/local/Library/Homebrew/cmd/install.rb:86:in `install_formulae'
/usr/local/Library/Homebrew/cmd/install.rb:24:in `install'
/usr/local/bin/brew:83:in `<main>'

It tells me absolutely nothing and I don't know what the next step might be. Do you have any ideas?

I'm running on Mac OSX 10.6 and Ruby 1.9.2

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
Holger Sindbaek
  • 2,278
  • 6
  • 41
  • 68
  • Why don't you follow [the troubleshooting steps it tells you to and if that fails, report it](https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue)? – Andrew Marshall Jan 15 '12 at 19:03
  • I was hoping that somebody had tried a similar thing. Going through those steps seem very much like shooting in the dark. When I do brew doctor for example, it tells me that Ruby version 1.9.2 is unsupported, which seems very weird to me. Can that really be true? – Holger Sindbaek Jan 15 '12 at 19:09
  • It's clearly not shooting in the dark because it told you something that was wrong. Yes, it really is unsupported. And that means that you've overwritten `/usr/bin/ruby` with a 1.9 binary, which is not recommended since any OS X program using Ruby will assume that `/usr/bin/ruby` is 1.8.x. – Andrew Marshall Jan 15 '12 at 19:52
  • Ok... what would you recommend? can I keep using 1.9.2 for my application and use 1.8.x for homebrew? – Holger Sindbaek Jan 15 '12 at 20:01
  • don't even start down that path. Find an imagic magic version (see my answer below) or switch to a different solution (yes a small amount of code will have to be re-written on your side). – Michael Durrant Jan 15 '12 at 21:18
  • @HolgerEdwardWardlowSindbæk Yes, you can. Put Ruby 1.9 where it belongs: `/usr/local/bin/ruby`. – Andrew Marshall Jan 16 '12 at 03:45
  • Note "you can" and "you should" are different in this case imho – Michael Durrant Jan 16 '12 at 03:59
  • Additionally I researched it further and found that in ruby 1.9 the =~ is redefinabke whereas in 1.8 it wasn't. So this is another good potential culprit and a reason why 1.8 vs. 1.9 would make a difference. – Michael Durrant Jan 16 '12 at 04:00

1 Answers1

3

I'm curious at this point (Jan 2012) about major gems that don't seem to work with 1.9.2
For imagemagick I found a working 1.9.2 version detailed at:
http://yakobubaidullah.blogspot.com/2011/01/installing-papperclip-rmagick2.html

Note[1]: From experiences like this I have learned to pick my gems carefully, rating how 'popular' a gem is as a pretty good idea of how mainstream (and thus how likely to be upgraded for both ruby and rails versions).
For github gems I look at: How recently it was last updated (e.g. main github page). How many forks? How many downloads?

For rubygems I look at the number of downloads and the stats over time graphs

Note[2]: github is the older source for gems {and still the source for older gems}, rubygems is the 'new' place - but that also means for (relatively) new gems. This happened some time in 2010 / 2011 i believe.

From the site rubygems.org: "The project was started in April 2009 by Nick Quaranto, and has since grown to include the contributions of over 55 Rubyists and millions of gem downloads. As of the RubyGems 1.3.6 release, the site has been renamed to RubyGems.org from Gemcutter to solidify the site's central role in the Ruby community.
Some insights into the technical aspects of the site: It's 100% Ruby. The main site is a Rails application, and the RubyGem serving is done through Sinatra. Gems are hosted on Amazon S3, and the time between publishing a new gem and having it ready for installation is minimal. For more info, please check out the code, which is MIT licensed over at GitHub."

These links may also help:

Can't install Imagemagick on Mac with Brew

Cannot install older version of ImageMagick via Homebrew

Installation of imagemagick with BREW

Note[3]: Finally, as I commented above, in ruby 1.9 the =~ is redefinable whereas in 1.8 it wasn't.

Community
  • 1
  • 1
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497