Error: undefined method `=~' when installing I

2019-02-28 16:33发布

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

1条回答
走好不送
2楼-- · 2019-02-28 16:56

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.

查看更多
登录 后发表回答