[英]Can't install gem rmagick
我正在嘗試在運行 montaray osx 12 的新 Mac 上安裝 rmagick
我已經安裝了 rbenv、bundler 等,現在運行 bundle install 我得到了
Installing rmagick 4.2.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/will/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/rmagick-4.2.4/ext/RMagick
/Users/will/.rbenv/versions/2.7.5/bin/ruby -I /Users/will/.rbenv/versions/2.7.5/lib/ruby/2.7.0 -r
./siteconf20221003-4792-u83yc4.rb extconf.rb
checking for brew... yes
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... yes
ERROR: Can't install RMagick 4.2.4. Can't find ImageMagick with pkg-config
*** 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=/Users/will/.rbenv/versions/2.7.5/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/will/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rmagick-4.2.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/will/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems/rmagick-4.2.4 for
inspection.
Results logged to
/Users/will/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rmagick-4.2.4/gem_make.out
An error occurred while installing rmagick (4.2.4), and Bundler cannot continue.
Make sure that `gem install rmagick -v '4.2.4' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
rmagick
我已經用自制軟件安裝了 pkg-config 和 imagemagick@6
我已經按照各種 SO 答案進行調試,但沒有任何效果。 如何安裝 rmagick?
更新我的 /Users/will/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rmagick-4.2.4/mkmf.log 文件的內容–
find_executable: checking for brew... -------------------- yes
--------------------
assert_minimum_ruby_version!: checking for Ruby version >= 2.3.0... -------------------- yes
--------------------
find_executable: checking for pkg-config... -------------------- yes
--------------------
ERROR: Can't install RMagick 4.2.4. Can't find ImageMagick with pkg-config
目前與自制軟件安裝的“高速公路”發生沖突
安裝 rmagick 的解決方法
brew install pkg-config imagemagick
brew uninstall highway
bundle install
brew install highway
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.