在stackoverflow中浏览了许多博客以安装rmagick,但没有找到解决方案。非常感谢您的帮助。
尝试使用卸载并重新安装imagemagick。像Install rmagick
那样流动一些链接这是输出
sudo gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/rmagick-
2.16.0/ext/RMagick
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r
./siteconf20181206-50407-46eq96.rb extconf.rb
checking for xcrun... yes
checking for Magick-config... yes
checking for outdated ImageMagick version (<= 6.4.9)... no
checking for presence of MagickWand API (ImageMagick version >=
6.9.0)... no
*** 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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
extconf.rb:104:in ``': No such file or directory - MagickWand-config
(Errno::ENOENT)
from extconf.rb:104:in `configure_compile_options'
from extconf.rb:16:in `initialize'
from extconf.rb:548:in `new'
from extconf.rb:548:in `<main>'
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/rmagick-2.16.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/Library/Ruby/Gems/2.3.0/gems/rmagick-2.16.0 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-
darwin-18/2.3.0/rmagick-2.16.0/gem_make.out
答案 0 :(得分:2)
如果您已经按照链接中的说明安装了Imagemagick,则您的shell可能会缺少二进制文件的路径。您可以通过运行控制台命令进行测试:
which MagickWand-config
如果它返回路径(可能是/usr/local/bin/MagickWand-config
),则您的路径可能没问题。如果返回MagickWand-config not found
,您应该可以在控制台中输入export PATH=/usr/local/bin:$PATH
。
如果之前的路径不正确,则在运行export命令后,可以重新运行which MagickWand-config
命令以确认它在您的路径中。然后尝试再次gem install rmagick
。
我能够按照您发布的链接在Mojave上安装rmagick。
如果这确实解决了您的问题,那么您还需要添加我在您的~/.bash_profile
或~/.zsh_profile
文件中记下的导出命令,以便该路径在每个终端窗口中都为前缀(如果尚未存在) )