无法安装 RMagick 2.13.1。找不到 MagickWand.h。

发布于 2024-12-29 10:55:51 字数 395 浏览 5 评论 0原文

当我尝试安装 rmagick 时,收到以下错误消息:

Can't install RMagick 2.13.1. Can't find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

我使用的是 Mac OSX 10.6.8、ruby 1.9.2p290、rvm 1.10.2。

谁能帮我解决这个问题。

When I try do install rmagick I get the following error message:

Can't install RMagick 2.13.1. Can't find MagickWand.h.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

I'm on Mac OSX 10.6.8, ruby 1.9.2p290, rvm 1.10.2.

Can anyone help me please to solve this problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(30

那小子欠揍 2025-01-05 10:55:51

如果你使用的是 Ubuntu,安装这个包就可以解决这个问题:

sudo apt-get install libmagickwand-dev

If you're on Ubuntu, installing this package is what fixed it for me:

sudo apt-get install libmagickwand-dev
小草泠泠 2025-01-05 10:55:51

看起来 ImageMagick 7 更改了包含文件路径。

在构建rmagick时,因为它包含文件wand/MagickWand.h,所以没有解决方法。现在看起来还是坚持使用 ImageMagick 6。

在 Mac OS X(我在 Sierra 上测试)上,我使用 HomeBrew 的 versions 点击:

brew tap homebrew/versions
brew install imagemagick@6

然后,使用上面安装中显示的路径:

PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick

使用 ImageMagick 6 进行安装。

It looks like ImageMagick 7 changed include file path.

On building rmagick, since it includes file as wand/MagickWand.h There are no workarounds. It looks like sticking with ImageMagick 6 for now.

On Mac OS X (I tested on Sierra), I used HomeBrew's versions tap like:

brew tap homebrew/versions
brew install imagemagick@6

Then, use the path shown on above installation:

PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick

To install with ImageMagick 6.

你的他你的她 2025-01-05 10:55:51

我不想弄乱环境变量,因为我希望捆绑器能够在 CI 机器上自行编译这个 gem。相反,我使用 Homebrew 安装 pkg-config:

brew install pkgconfig

,下次我尝试编译 RMagick gem 时,它发现头文件没有问题。

(这是 pkg-config 0.28、ImageMagick 6.8.0-10 和 RMagick 2.13.2,均位于 Mountain Lion 上。)

I didn't want to mess with environment variables since I wanted bundler to be able to compile this gem on its own on a CI machine. Instead, I used Homebrew to install pkg-config:

brew install pkgconfig

and the next time I tried compiling the RMagick gem it found the header file without issue.

(This is pkg-config 0.28, ImageMagick 6.8.0-10, and RMagick 2.13.2, all on Mountain Lion.)

本王不退位尔等都是臣 2025-01-05 10:55:51

我在运行时遇到了类似的问题

$ gem install rmagick

首先,您是否安装了 imagemagick?如果您不确定,请运行

$ convert --version

如果您确定,您可能使用 fink 或 macports (也许是自制程序?)安装了它。发生的情况是 rvm 找不到 imagemagick 目录。

读完后
https://superuser.com/questions/ 361435/i-have-compiled-imagemagick-on-my-centos-and-rmagick-wont-install
我通过添加到我的 ~/.bash_profile 中导出 imagemagick 路径

$ export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH"

,获取新的配置文件,然后运行:

gem install rmagick

在我这样做之后,它对我有用。

I had a similar issue with running

$ gem install rmagick

First of all, do you have imagemagick installed? If you're not sure, run

$ convert --version

If you do, you probably either installed it with fink or macports (maybe homebrew?). What is happening is that rvm can't find the imagemagick directory.

After reading
https://superuser.com/questions/361435/i-have-compiled-imagemagick-on-my-centos-and-rmagick-wont-install
I exported the imagemagick path by adding

$ export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH"

to my ~/.bash_profile, sourcing the new profile, then running:

gem install rmagick

It worked for me after I did this.

落花浅忆 2025-01-05 10:55:51

修复此设置当前 imagemagick 安装的包含路径:

使用brew

brew install imagemagick

find 库

$ mdfind MagickWand.h
/usr/local/Cellar/imagemagick/6.7.5-7/include/ImageMagick/wand/MagickWand.h

安装 ImageMagick安装 rmagick gem

$ C_INCLUDE_PATH=/path/MagickWand.h gem install rmagick

示例:

$ C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.5-7/include/ImageMagick/ gem install rmagick

fix this setting the include path of your current imagemagick installation:

Install ImageMagick with brew

brew install imagemagick

find library

$ mdfind MagickWand.h
/usr/local/Cellar/imagemagick/6.7.5-7/include/ImageMagick/wand/MagickWand.h

Install rmagick gem

$ C_INCLUDE_PATH=/path/MagickWand.h gem install rmagick

example:

$ C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.5-7/include/ImageMagick/ gem install rmagick
随遇而安 2025-01-05 10:55:51

我将其标记为最喜欢的,因为它似乎会在我需要安装 RMagick 的每个新系统上再次困扰我(时间已经过去,版本号已经滚动)。

Mac OS X 10.8.4

rvm 1.22.3

ruby​​-2.0.0-p247

安装了 Xcode 4.6.3 开发人员工具

$ brew install imagemagick
==> /usr/local/Cellar/imagemagick/6.8.6-3

$ brew install pkgconfig
==> /usr/local/Cellar/pkg-config/0.28

$ C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.6-3/include/ImageMagick-6 PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.6-3/lib/pkgconfig/ gem install rmagick
Successfully installed rmagick-2.13.2

非常感谢上面添加有用答案的每个人!

I marked this as a favorite because it seems to come back to bite me with every new system I need to install RMagick on (and time has passed and version numbers have rolled).

Mac OS X 10.8.4

rvm 1.22.3

ruby-2.0.0-p247

Xcode 4.6.3 developer tools installed

$ brew install imagemagick
==> /usr/local/Cellar/imagemagick/6.8.6-3

$ brew install pkgconfig
==> /usr/local/Cellar/pkg-config/0.28

$ C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.8.6-3/include/ImageMagick-6 PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.6-3/lib/pkgconfig/ gem install rmagick
Successfully installed rmagick-2.13.2

Many thanks to everyone who added helpful answers above!

鼻尖触碰 2025-01-05 10:55:51

使用brew的Mac用户

如果您可以使用ImageMagick v6而不是7,您可以尝试这个

brew install imagemagick@6 --force && brew link imagemagick@6 --force

注意,这将取消链接您现有的IM安装,因此如果您的计算机上有其他项目使用ImageMagick没有问题,请小心。

Mac users using brew

If you can use v6 of ImageMagick instead of 7, you can try this

brew install imagemagick@6 --force && brew link imagemagick@6 --force

Note this will unlink your existing IM installation, so be careful if you have other projects on your machine using ImageMagick without problems.

杀手六號 2025-01-05 10:55:51

为了我自己和其他人的启发,我通过使用建议 xonico 克服了 magicwand.h 的错误。 MDFind 加上 C_INCLUDE_PATH。然而,它随后给了我一个关于 MagickCore.pc 的错误。我完成此工作的最终命令必须包括两者,如下所示:

 C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/ PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/lib/pkgconfig/ gem install rmagick

显然,您的路径会有所不同,具体取决于您是否像我一样使用brew以及您安装的imagemagick版本。此外,正如其他人提到的那样,确实必须安装 xcode 命令行工具。

感谢大家对此的帖子!我加上你的答案,因为它对我的贡献!

For my own and others edification, I got past the error about the magicwand.h by using the suggestion xonico. MDFind plus the C_INCLUDE_PATH. However, it then gave me an error about MagickCore.pc. My final command to get this working had to include both like so:

 C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/ PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/lib/pkgconfig/ gem install rmagick

Obviously your paths will vary depending on whether you're using brew like me and what version of imagemagick you were installing. Also, xcode command line tools did have to be installed, as others have mentioned.

Thanks for everyone's posts on this! I am plussing your answers since it contributed to mine!

不顾 2025-01-05 10:55:51

对于Ubuntu:

sudo apt-get install imagemagick libmagickwand-dev
gem install rmagick

For Ubuntu:

sudo apt-get install imagemagick libmagickwand-dev
gem install rmagick
浊酒尽余欢 2025-01-05 10:55:51

更新到 Maverics 后我遇到了问题。
它失去了很多链接。
就我而言,我必须刷新 pkg-config 的链接

brew unlink pkg-config
brew link pkg-config

然后安装 rmagick 就非常有效。

I had a problem after update to Maverics.
It have lost a lot of linkings.
In my case I had to refresh links to pkg-config

brew unlink pkg-config
brew link pkg-config

Then installing rmagick worked like a charm.

梦里梦着梦中梦 2025-01-05 10:55:51

我更新到 Mountain Lion 并开始遇到同样的问题。我必须重新安装brew、XCode、XCode 工具——几乎整个环境!

我最终使用上面 phopkins 的答案解决了这个问题...

brew install pkgconfig

一旦成功完成(我必须先删除一些旧的符号链接),那么我就能够成功安装 RMagick gem

I updated to Mountain Lion and started getting this same problem. I had to re-install brew, XCode, the XCode tools - pretty much the whole environment!

I eventually solved this problem using the answer from phopkins above...

brew install pkgconfig

Once that was successfully completed (I had to delete some old symlinks first) then I was able to successfully install the RMagick gem

阳光下慵懒的猫 2025-01-05 10:55:51

这对我在Mac OsX上有用

安装Imagemagick:

brew remove imagemagick
brew install imagemagick

确保pkg-config正确链接:

brew uninstall pkg-config
brew install pkg-config
brew unlink pkg-config && brew link pkg-config

安装gem

gem install rmagick

This worked for me on Mac OsX

Install Imagemagick:

brew remove imagemagick
brew install imagemagick

Make sure pkg-config is correctly linked:

brew uninstall pkg-config
brew install pkg-config
brew unlink pkg-config && brew link pkg-config

Install gem

gem install rmagick
往日情怀 2025-01-05 10:55:51

对于 Ubuntu 用户:
它永远不会直接在 Ubuntu 上完成。您应该首先安装软件包来运行此命令...:

sudo apt-get install libmagickwand-dev  

...然后进行安装:

gem install rmagick

您可能会遇到相同的问题,为此,请尝试先清除 apt 存储库并删除任何损坏的软件包:

sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove

如果系统识别出任何损坏的软件包,强制删除它们(将 package_name 替换为您自己的):

sudo dpkg --remove -force --force-remove-reinstreq package_name

然后再次重新安装所有丢失的软件包。 :)

For Ubuntu users:
It will never done directly on Ubuntu. You should first install packages to run this command...:

sudo apt-get install libmagickwand-dev  

...and then do install:

gem install rmagick

You may get the same issue, for that, Try clearing your apt repository and removing any broken packages first:

sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove

If the system identifies any broken packages, forcefully remove them (replace package_name with your own):

sudo dpkg --remove -force --force-remove-reinstreq package_name

Then re-install any missing packages again. :)

謌踐踏愛綪 2025-01-05 10:55:51

对我来说,一个问题是 rmagick 已经过时并且没有定期更新。如果您的 ImageMagick 版本太新,则它可能不兼容。使用以下方法检查您的 ImageMagick 版本:

$ convert --version

如果 ImageMagick 版本 > 7、与rmagick不兼容。用户将收到诸如

Can't install RMagick 2.16.0. Can't find MagickWand.h.
*** extconf.rb failed *** 

“返回到 ImageMagick 版本 6”之类的错误,直到他们更新 rmagick 以与 ImageMagick 版本 7 兼容。有人在单独的 gem - 'imagemagick@6' 中托管了适当的版本(6)。

如果您需要 rmagick 才能工作,但当前拥有 imagemagick 版本 7 或更高版本,请执行以下切换步骤:

$ gem install imagemagick@6
$ brew unlink imagemagick
$ brew link imagemagick@6 --force

An issue for me was that rmagick is out of date and not updated regularly. If you have too new of an ImageMagick version, then it might not be compatible. Check your version of ImageMagick using the following:

$ convert --version

If the ImageMagick version is > 7, it is not compatable with rmagick. The user will get errors such as

Can't install RMagick 2.16.0. Can't find MagickWand.h.
*** extconf.rb failed *** 

Go back to version six of ImageMagick until they update rmagick to be compatible with version seven of ImageMagick. Someone has hosted the appropriate version(6) in a separate gem - 'imagemagick@6'.

If you need rmagick to work but currently have an imagemagick version 7 or higher, here are the steps to switch:

$ gem install imagemagick@6
$ brew unlink imagemagick
$ brew link imagemagick@6 --force
嘿嘿嘿 2025-01-05 10:55:51

在 Debian Wheezy 64 位上帮助我

 apt-get install libmagickcore-dev libmagickwand-dev

Helped me on Debian Wheezy 64bit

 apt-get install libmagickcore-dev libmagickwand-dev
尝蛊 2025-01-05 10:55:51

尝试重新安装 Imagemagick 和 PkgConfig。 的问题

  • 这应该可以修复 Mavericks brew update && 。 brew升级
  • brew重新安装imagemagick
  • brew重新安装pkgconfig

Try reinstalling both Imagemagick and PkgConfig. That should fix it for Mavericks

  • brew update && brew upgrade
  • brew reinstall imagemagick
  • brew reinstall pkgconfig
坚持沉默 2025-01-05 10:55:51
C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick gem install rmagick
C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick gem install rmagick
拥醉 2025-01-05 10:55:51

我在 OS X Mountain Lion 上(从 Lion 升级后)确实遇到了这个问题,并且有关 C_INCLUDE_PATH、PKG_CONFIG_PATH、ln'ing 各种文件等的建议都不起作用。在升级到 Mountain Lion 的同一天,我也将 XCode 升级到了 4.5.2,但我并没有对此想太多。

最终我停止尝试安装 RMagick,不得不将工作交给同事。

然后,一个偶然的机会,我发现我试图在另一个项目上使用bundle install,但无法安装json gem,因为找不到“make”。我检查了一下,发现你需要去 XCode ->首选项->下载并安装命令行工具以使 make 再次工作。 json gem 安装得很好。

然后我停下来……又尝试了

gem install rmagick

一次。它工作得很好。

I was really struggling with this on OS X Mountain Lion (after upgrading from Lion) and none of the suggestions regarding C_INCLUDE_PATH, PKG_CONFIG_PATH, ln'ing various files, etc., were working. On the same day I upgraded to Mountain Lion, I also upgraded XCode to 4.5.2, but I didn't really think too much of this.

Eventually I stopped trying to install RMagick and had to pass on the work to a colleague.

Then, by chance, I found that I was trying to use bundle install on another project and I wasn't able to install the json gem because "make" could not be found. I checked into that and found you need to go to XCode -> Preferences -> Downloads and install the command line tools to get make working again. The json gem installed fine.

Then I paused...and tried

gem install rmagick

One more time. It worked perfectly.

那小子欠揍 2025-01-05 10:55:51

对于基于 Rails 的应用程序,我发现这

sudo apt-get install -y libmagickwand-6-headers
C_INCLUDE_PATH=/usr/include/ImageMagick-6 gem install rmagick
bundle update rmagick
bundle install

适用于 debian jessie

for a rails based application, I found this

sudo apt-get install -y libmagickwand-6-headers
C_INCLUDE_PATH=/usr/include/ImageMagick-6 gem install rmagick
bundle update rmagick
bundle install

worked on debian jessie

世界和平 2025-01-05 10:55:51

我遇到这个问题是因为我运行了 OS X 的迁移助手,并且迁移后没有任何内容被重新链接。您需要检查 Wand-config --ldflags --libs 的输出。在我的例子中,它给出:

$ Wand-config --ldflags --libs
/usr/local/bin/Wand-config: line 50: pkg-config: command not found
/usr/local/bin/Wand-config: line 53: pkg-config: command not found

重新链接 pkg-config、libpng 和 libfreetype 后,变成:

$ Wand-config --ldflags --libs
-L/usr/local/Cellar/imagemagick/6.8.8-9/lib -lMagickWand-6.Q16 -lMagickCore-6.Q16 
-L/usr/local/Cellar/imagemagick/6.8.8-9/lib -lMagickWand-6.Q16 -lMagickCore-6.Q16 

然后:

$ gem install rmagick
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.2
Parsing documentation for rmagick-2.13.2
Done installing documentation for rmagick after 4 seconds
1 gem installed

I ran into this because I'd run OS X's Migration Assistant and nothing was relinked after the migration. You need to check the output of Wand-config --ldflags --libs. In my case it gave:

$ Wand-config --ldflags --libs
/usr/local/bin/Wand-config: line 50: pkg-config: command not found
/usr/local/bin/Wand-config: line 53: pkg-config: command not found

After relinking pkg-config, libpng, and libfreetype, that became:

$ Wand-config --ldflags --libs
-L/usr/local/Cellar/imagemagick/6.8.8-9/lib -lMagickWand-6.Q16 -lMagickCore-6.Q16 
-L/usr/local/Cellar/imagemagick/6.8.8-9/lib -lMagickWand-6.Q16 -lMagickCore-6.Q16 

And then:

$ gem install rmagick
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.2
Parsing documentation for rmagick-2.13.2
Done installing documentation for rmagick after 4 seconds
1 gem installed
ι不睡觉的鱼゛ 2025-01-05 10:55:51

linux 操作系统中:

C_INCLUDE_PATH=/usr/local/include/ImageMagick-6/ gem install rmagick

构建本机扩展。这可能需要一段时间...

ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

        /home/vagrant/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
...
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'

然后:

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

在我的 .bashrc 文件中选择 MagickCore.pc,然后创建两个符号链接:

ln -s /usr/local/include/ImageMagick/wand /usr/local/include/ImageMagick-6/wand
ln -s /usr/local/include/ImageMagick/magick /usr/local/include/ImageMagick-6/magick

现在:

$ gem install rmagick
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.2
1 gem installed

繁荣一切正常。

In linux OS:

C_INCLUDE_PATH=/usr/local/include/ImageMagick-6/ gem install rmagick

Building native extensions. This could take a while...

ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

        /home/vagrant/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
...
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'

then:

export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"

in my .bashrc file to pick up MagickCore.pc, then created two symlinks:

ln -s /usr/local/include/ImageMagick/wand /usr/local/include/ImageMagick-6/wand
ln -s /usr/local/include/ImageMagick/magick /usr/local/include/ImageMagick-6/magick

Now:

$ gem install rmagick
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.2
1 gem installed

boom everything works fine.

傻比既视感 2025-01-05 10:55:51

在 arch linux 上,安装 imagemagick@6 后,gem 无法安装 rmagick 包并出现以下错误。

Can't install RMagick 2.16.0. Can't find MagickWand.h

使用以下步骤为我工作

  1. 将 pkgconfig 路径添加到 .bashrc

    export PKG_CONFIG_PATH="/usr/lib/imagemagick6/pkgconfig"

  2. 创建了两个符号链接,如下

    ln -s /usr/include/ImageMagick-6/wand /usr/include/ImageMagick-6/wand

    ln -s /usr/local/include/ImageMagick/magick /usr/include/ImageMagick-6/magick

At arch linux, after installing imagemagick@6, gem wasn't able to install package rmagick and got error below.

Can't install RMagick 2.16.0. Can't find MagickWand.h

Worked for me using below steps

  1. added pkgconfig path to .bashrc

    export PKG_CONFIG_PATH="/usr/lib/imagemagick6/pkgconfig"

  2. Created two symlinks as below

    ln -s /usr/include/ImageMagick-6/wand /usr/include/ImageMagick-6/wand

    ln -s /usr/local/include/ImageMagick/magick /usr/include/ImageMagick-6/magick

怀中猫帐中妖 2025-01-05 10:55:51

这个问题有一些变体。大多数情况是处理运行旧版本 ruby​​ 的遗留应用程序。

rmagick 依赖于 imagemagick...但不仅仅是任何依赖。如果你已经走得太远,回溯可能是明智的:

brew uninstall imagemagick

然后继续使用适当的版本

brew install imagemagick@6

,然后需要调整你的路径并强制使用自制程序,

export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"
brew link --force imagemagick@6

然后你可以将 rmagick 安装到最新版本或版本

gem install rmagick -v '2.15.4' --source 'https://rubygems.org/'

There are some variants to this problem. Mostly the case is dealing with a legacy application that run older versions of ruby.

rmagick has a dependancy on imagemagick... but not just any. If you've gone too far ahead, it may be wise to backtrack:

brew uninstall imagemagick

Then proceed with an appropriate version

brew install imagemagick@6

then you path needs to be adjusted and forced upon homebrew

export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"
brew link --force imagemagick@6

then you can install rmagick to most recent or versioned

gem install rmagick -v '2.15.4' --source 'https://rubygems.org/'
窗影残 2025-01-05 10:55:51

当我在 OSX 10.8 上默认安装 ImageMagick(没有自制程序或 ma​​cports)时,我很难解决同样的问题。该线程中的建议或从该线程链接到的线程中的建议组合都不适合我(当然修改我的本地安装的路径)。

我只是删除了默认的 ImageMagick 6 安装,然后用 macports 重新安装。我的 rmagick 安装立即生效,没有进行任何其他更改。

I had a hard time getting this same issue to work when I had a default ImageMagick install on OSX 10.8 (no homebrew or macports). No combination of the suggestions in this thread or threads linked to from this thread worked for me (modifying the paths for my local install of course).

I simply deleted the default ImageMagick 6 install, and then reinstalled with macports. My rmagick install worked immediately after with no other changes.

陪我终i 2025-01-05 10:55:51

在 OSX Maverick 10.9.1 上
我花了很长时间才弄清楚,但我通过以下方式解决了这些问题:

nano /etc/paths

更改

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

为:

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

首先加载本地内容,例如“brew”。

是否有什么问题

现在我在终端中输入“brew doctor”,看看如果得到以下输出,
您的系统已准备好酿造。
一切都很好。如果没有,我会告诉你该怎么做。比如踢出未酿造的东西、损坏的库、干净的符号链接等等。

当你准备好brew时,你需要通过brew使用ghostscript(用于pdf)、libpng、imagemagick。

然后你可以愉快地输入:“gem install rmagick”,以防你没有终止你的 ruby​​ 设置。但通过清理后的啤酒重新安装很容易。

附:
另一个有用的命令是:'which Convert',向您显示系统使用的 imagemagick 版本。

以及--version,

所以如果你通过brew安装了git并执行'git --version'并且它返回了一些苹果git版本,那么你的加载路径就被破坏了......

on OSX Maverick 10.9.1
it took me ages to figure it out but I solved these issues the following way:

nano /etc/paths

changed:

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

into:

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

that that local stuff, like 'brew' is loaded first.

now I hit 'brew doctor' into the terminal, to see if there's something messed up

if you get the following output
Your system is ready to brew.
everthing is fine. if not ti will tell you what to do. Like kick out unbrewed stuff, broken libs, clean symlinks and whatnot.

When you are ready to brew, you need ghostscript(for pdfs), libpng, imagemagick via brew.

then you can happily type : 'gem install rmagick', in case you did't kill your ruby setup. But thats easy to reinstall via your cleaned up brew.

PS:
another helpful command is: 'which convert', to show you what version of imagemagick is used by the system.

as well as --version

so if you installed git via brew and do 'git --version' and it returns some apple git version, your load path is broken...

你げ笑在眉眼 2025-01-05 10:55:51

在 Mac OS X 10.9 上,如果出现警告,请尝试更新您的 Xcode。
$ 酿造医生
如果您发现一些警告,请执行以下操作:
$ sudo /Developer/Library/uninstall-developer-folder

然后尝试:
$ 捆绑安装
这对我来说

效果很好。

On Mac OS X 10.9, try to update your Xcode if there's a warning about it.
$ brew doctor
I you found some warning, do:
$ sudo /Developer/Library/uninstall-developer-folder

Then try:
$ bundle install
again

That worked fine for me.

初与友歌 2025-01-05 10:55:51

在 CentOS 6.5 x64 上,这非常简单:

yum install ImageMagick ImageMagick-devel

gem install rmagick -v '2.13.2'

On CentOS 6.5 x64, it was pretty easy:

yum install ImageMagick ImageMagick-devel

gem install rmagick -v '2.13.2'
剧终人散尽 2025-01-05 10:55:51

我可以通过升级到 2.13.2 来解决这个问题

I was able to fix this by upgrading to 2.13.2

生死何惧 2025-01-05 10:55:51

所有brew选项都无法在yosemite 10.10上安装rmagick 2.13.1,

这有效
获取最新的RVM

\curl -sSL https://get.rvm.io | bash -s 稳定--ruby
rvm安装2.1.1
rvm使用2.1.1

下载并安装包文件
http://cactuslab.com/imagemagick

(我使用 pacifist 安装)

确认 MagickCore.pc 文件的位置

mdfind magickcore.pc

例如。 /opt/ImageMagick/lib/pkgconfig/MagickCore.pc

手动下载rmagick-2.15.2.gem文件
https://rubygems.org/gems/rmagick/versions/2.15.2

从那个目录

sudo C_INCLUDE_PATH=/opt/ImageMagick/include/ImageMagick-6/ PKG_CONFIG_PATH=/opt/ImageMagick/lib/pkgconfig gem install --local rmagick-2.15.2.gem

如果您遇到捆绑安装程序问题,仍然抱怨 2.13.1

在你的 gem 文件/gem.lock 文件中升级所有依赖项

rmagick (2.13.1) -> rmagick (>= 2.15.2)

All brew options failed to install rmagick 2.13.1 on yosemite 10.10

this worked
get the latest RVM

\curl -sSL https://get.rvm.io | bash -s stable --ruby
rvm install 2.1.1
rvm use 2.1.1

download and install the package file
http://cactuslab.com/imagemagick

(I used pacifist to install)

Confirm location of MagickCore.pc file

mdfind magickcore.pc

eg. /opt/ImageMagick/lib/pkgconfig/MagickCore.pc

Manually download rmagick-2.15.2.gem file
https://rubygems.org/gems/rmagick/versions/2.15.2

from that dir

sudo C_INCLUDE_PATH=/opt/ImageMagick/include/ImageMagick-6/ PKG_CONFIG_PATH=/opt/ImageMagick/lib/pkgconfig gem install --local rmagick-2.15.2.gem

If you are having issues with bundle installer still complaining about 2.13.1

In your gem file / gem.lock file upgrade ALL dependencies

rmagick (2.13.1) - > rmagick (>= 2.15.2)

情未る 2025-01-05 10:55:51

alpine 3.9 镜像构建也出现同样的错误。它带有 ImageMagick 7.0.8.38-r0< /a>

要解决这个问题,您可以使用 alpine 3.5 和 ImageMagick 6.9.6.8-r1

FROM alpine:3.5

或者安装 ImageMagick 6.9.6.8-r1 以及 3.5 的软件包存储库:

RUN apk add imagemagick-dev=6.9.6.8-r1 --repository http://dl-3.alpinelinux.org/alpine/v3.5/main/

rmagick 存储库中存在一个关于 ImageMagick 7.0.x 构建失败的未决问题。所以希望它能尽快修复。

Got same error for alpine 3.9 image build. It comes with ImageMagick 7.0.8.38-r0

To fix that you either use alpine 3.5 with ImageMagick 6.9.6.8-r1:

FROM alpine:3.5

Or install ImageMagick 6.9.6.8-r1 with package repository for 3.5:

RUN apk add imagemagick-dev=6.9.6.8-r1 --repository http://dl-3.alpinelinux.org/alpine/v3.5/main/

There is an open issue in rmagick repo regarding failed builds for ImageMagick 7.0.x. so hopefully it will be fixed soon.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文