简体   繁体   English

ImageMagick / RMagick - 无法安装 RMagick 2.13.1。 找不到魔法配置

[英]ImageMagick / RMagick - Can't install RMagick 2.13.1. Can't find Magick-config

I used a script to install ImageMagick http://github.com/masterkain/ImageMagick-sl我使用了一个脚本来安装 ImageMagick http://github.com/masterkain/ImageMagick-sl

After a while, I got ImageMagick installed.过了一会儿,我安装了 ImageMagick。

Then I ran sudo gem install rmagick and got然后我运行 sudo gem install rmagick 并得到

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.

.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in...

I'm working in OSX Snow Leopard with Ruby 1.9.2 and Rails 3. Any ideas?我正在使用 Ruby 1.9.2 和 Rails 3 的 OSX Snow Leopard 工作。有什么想法吗?

I was getting the same error and it got resolved after installing the libmagick9-dev library on ubuntu 11.我遇到了同样的错误,在 ubuntu 11 上安装 libmagick9-dev 库后它得到了解决。



Update (Thanks to the commenters - Dec. 2012)更新(感谢评论者 - 2012 年 12 月)

$ sudo apt-get install libmagickwand-dev or $ sudo apt-get install graphicsmagick-libmagick-dev-compat for ubuntu 12 $ sudo apt-get install libmagickwand-dev$ sudo apt-get install graphicsmagick-libmagick-dev-compat for ubuntu 12

$ sudo apt-get install libmagickwand-dev or $ sudo apt-get install libmagick9-dev for ubuntu 11 or below. $ sudo apt-get install libmagickwand-dev$ sudo apt-get install libmagick9-dev适用于 ubuntu 11 或更低版本。

$ yum install ImageMagick-devel for centos $ yum install ImageMagick-devel for centos

$ brew install imagemagick for Mac OS (using Homebrew) $ brew install imagemagick for Mac OS(使用 Homebrew)

you need the imagemagick libraries under ubuntu你需要ubuntu下的imagemagick库

$ sudo apt-get install libmagickwand-dev

it contains all missing libraires它包含所有丢失的图书馆

then run bundle install command然后运行bundle install命令

I believe you need the Imagemagick libraries.我相信您需要 Imagemagick 库。

If you are using Homebrew (which I'd highly recommend), simply do如果您正在使用Homebrew (我强烈推荐),只需执行

$ brew install imagemagick

Then rerun bundle install然后重新运行 bundle install

Mac OS Mountain Loin (using Homebrew) Mac OS Mountain Loin(使用 Homebrew)

  1. download and install http://xquartz.macosforge.org/trac/wiki/X112.7.2下载安装http://xquartz.macosforge.org/trac/wiki/X112.7.2
  2. brew install imagemagick
  3. gem install rmagick
sudo apt-get install libmagickwand-dev 

works well for Ubuntu 12.10适用于 Ubuntu 12.10

This is assuming you have installed all other dependencies viz.这假设您已经安装了所有其他依赖项,即。

sudo apt-get install imagemagick ruby ruby-dev gem`

For those who got对于那些得到

InitializeMagick() in -lMagickCore... no; -lMagick... no; -lMagick++... no;

this worked for me in OS X 10.8: https://github.com/maddox/magick-installer这在 OS X 10.8 中对我有用: https : //github.com/maddox/magick-installer

From here: RVM + Ruby 1.9.2 + Rmagick + Lion = System Works, RVM Doesn't从这里开始: RVM + Ruby 1.9.2 + Rmagick + Lion = System Works,RVM 不工作

On CentOS 5.7, I got it to work by first specifying PKG_CONFIG_PATH :在 CentOS 5.7 上,我首先指定PKG_CONFIG_PATH使其工作:

export PKG_CONFIG_PATH=/usr/local/src/ImageMagick-6.7.5-10/magick/

gem install rmagick

Initially, I came around to installing rmagick because it seemed to be a dependency when I tried installing libgtk2.0-dev .最初,我开始安装 rmagick,因为当我尝试安装libgtk2.0-dev时,它似乎是一个依赖libgtk2.0-dev I was trying to install that package, because the RGtk2.0 is a requirement for using R package called rattle .我试图安装那个包,因为RGtk2.0是使用 R 包的必要条件,叫做rattle

Anyway, none of the above solutions worked for me in installing in my Ubuntu 12.04.无论如何,在我的 Ubuntu 12.04 中安装时,上述解决方案都不适合我。 Even running sudo apt-get update first didn't seem to help, nor this related posting: Installing rmagick on Ubuntu即使首先运行sudo apt-get update似乎也没有帮助,这篇相关的帖子也没有: 在 Ubuntu 上安装 rmagick

I eventually found what works is to troubleshoot using sudo aptitude rather than apt-get .我最终发现有效的是使用 sudo aptitude而不是apt-get进行故障排除。 https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages https://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages

I recommend the technique of using aptitude to work through the package installation issue.我推荐使用aptitude来解决软件包安装问题的技术。

On Mac Os X, check if /opt/local/bin is in your PATH .在 Mac Os X 上,检查/opt/local/bin是否在您的PATH If not:如果不是:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
sudo gem install rmagick

This worked for me!这对我有用!

I had an issue installing Rmagick gem version 2.13.2 on Debian Jessie.我在 Debian Jessie 上安装 Rmagick gem 2.13.2 版时遇到问题。 After fighting with the packages in the other answers, I upgraded the version of the Rmagick gem from 2.13.2 to the latest (2.16.0 at time of writing).在与其他答案中的软件包进行斗争后,我将 Rmagick gem 的版本从 2.13.2 升级到最新版本(撰写本文时为 2.16.0)。 This installed successfully.这样就安装成功了。

bundle update rmagick

If you tried all solutions, of all posts of whole Internet, have installed and reinstalled many times all indicated packages in all Linux or Mac distributions/versions (even in Windows) and it still not working, close your terminal and open it again.如果您尝试了整个 Internet 上所有帖子的所有解决方案,在所有 Linux 或 Mac 发行版/版本(甚至在 Windows 中)中多次安装和重新安装所有指示的软件包,但仍然无法正常工作,请关闭您的终端并再次打开它。 Some times, even if your reload all shell environment, only after I reopen the terminal the bundle install was successfully completed.有时,即使您重新加载所有 shell 环境,也只有在我重新打开终端后,bundle 安装才能成功完成。

After several days of searching, my problema was related to some missing libraries, and the one that get the gem installed was this one:经过几天的搜索,我的问题与一些缺少的库有关,安装gem的库是这个:

brew install pkg-config

after this I did my bundle install again and it worked.在此之后,我再次安装了我的捆绑包并且它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM