ImageMagick / RMagick - 无法安装 RMagick 2.13.1。找不到 Magick-config
我使用脚本安装 ImageMagick http://github.com/masterkain/ImageMagick-sl
之后过了一会儿,我安装了 ImageMagick。
然后我运行 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...
我正在 OSX Snow Leopard 中使用 Ruby 1.9.2 和 Rails 3 工作。有什么想法吗?
I used a script to install ImageMagick http://github.com/masterkain/ImageMagick-sl
After a while, I got ImageMagick installed.
Then I ran sudo gem install rmagick and got
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(12)
我遇到了同样的错误,在 ubuntu 11 上安装 libmagick9-dev 库后问题得到解决。
更新(感谢评论者 - 2012 年 12 月)
$ sudo apt-get install libmagickwand-dev
或$ sudo apt-get installgraphicsmagick-libmagick-dev- compat
对于 ubuntu 12$ sudo apt-get install libmagickwand-dev
或$ sudo apt-get install libmagick9-dev
对于 ubuntu 11 或更低版本。$ yum install ImageMagick-devel
for centos$brew install imagemagick
for Mac OS(使用 Homebrew)I was getting the same error and it got resolved after installing the libmagick9-dev library on ubuntu 11.
Update (Thanks to the commenters - Dec. 2012)
$ sudo apt-get install libmagickwand-dev
or$ 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.$ yum install ImageMagick-devel
for centos$ brew install imagemagick
for Mac OS (using Homebrew)您需要 ubuntu 下的 imagemagick 库
$ sudo apt-get install libmagickwand-dev
它包含所有缺少的 libraires,
然后运行
bundle install
命令you need the imagemagick libraries under ubuntu
$ sudo apt-get install libmagickwand-dev
it contains all missing libraires
then run
bundle install
command我相信您需要 Imagemagick 库。
如果您使用 Homebrew (我强烈推荐),只需执行
然后重新运行捆绑安装
I believe you need the Imagemagick libraries.
If you are using Homebrew (which I'd highly recommend), simply do
Then rerun bundle install
Mac OS Mountain Loin(使用 Homebrew)
brew 安装 imagemagick
gem 安装 rmagick
Mac OS Mountain Loin (using Homebrew)
brew install imagemagick
gem install rmagick
适用于 Ubuntu 12.10
假设您已经安装了所有其他依赖项,即。
works well for Ubuntu 12.10
This is assuming you have installed all other dependencies viz.
在 CentOS 5.7 上,我首先指定 PKG_CONFIG_PATH 来让它工作:
On CentOS 5.7, I got it to work by first specifying
PKG_CONFIG_PATH
:对于那些在 OS X 10.8 中为我工作的人
: https://github.com/maddox/magick -安装程序
从这里:RVM + Ruby 1.9.2 + Rmagick + Lion = 系统工作,RVM 不工作
For those who got
this worked for me in OS X 10.8: https://github.com/maddox/magick-installer
From here: RVM + Ruby 1.9.2 + Rmagick + Lion = System Works, RVM Doesn't
最初,我开始安装 rmagick,因为当我尝试安装
libgtk2.0-dev
时,它似乎是一个依赖项。我试图安装该软件包,因为RGtk2.0
是使用名为rattle
的 R 软件包的要求。无论如何,以上解决方案都不适合我在 Ubuntu 12.04 中安装。即使首先运行 sudo apt-get update 似乎也没有帮助,相关帖子也没有帮助:在 Ubuntu 上安装 rmagick
我最终发现有效的方法是使用 sudo
aptitude
而不是apt-get
进行故障排除。https://askubuntu.com/questions/223237/unable- to- Correct-problems-you-have-held-broken-packages
我推荐使用
aptitude
来解决软件包安装问题。Initially, I came around to installing rmagick because it seemed to be a dependency when I tried installing
libgtk2.0-dev
. I was trying to install that package, because theRGtk2.0
is a requirement for using R package calledrattle
.Anyway, none of the above solutions worked for me in installing in my Ubuntu 12.04. Even running
sudo apt-get update
first didn't seem to help, nor this related posting: Installing rmagick on UbuntuI eventually found what works is to troubleshoot using sudo
aptitude
rather thanapt-get
.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.在 Mac Os X 上,检查
/opt/local/bin
是否在您的PATH
中。如果没有:这对我有用!
On Mac Os X, check if
/opt/local/bin
is in yourPATH
. If not:This worked for me!
我在 Debian Jessie 上安装 Rmagick gem 版本 2.13.2 时遇到问题。在与其他答案中的软件包进行斗争之后,我将 Rmagick gem 的版本从 2.13.2 升级到最新版本(撰写本文时为 2.16.0)。这样就安装成功了。
I had an issue installing Rmagick gem version 2.13.2 on Debian Jessie. 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). This installed successfully.
如果您尝试了整个互联网的所有帖子中的所有解决方案,并在所有 Linux 或 Mac 发行版/版本(甚至在 Windows 中)中多次安装和重新安装了所有指定的软件包,但它仍然无法正常工作,请关闭您的终端并再次打开它。有时,即使您重新加载所有 shell 环境,只有在我重新打开终端后,捆绑包安装才成功完成。
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. Some times, even if your reload all shell environment, only after I reopen the terminal the bundle install was successfully completed.
经过几天的搜索,我的问题与一些缺失的库有关,安装 gem 的库是这个:
brew install pkg-config
在此之后,我再次进行了捆绑安装,它成功了。
After several days of searching, my problema was related to some missing libraries, and the one that get the gem installed was this one:
brew install pkg-config
after this I did my bundle install again and it worked.