rmagick gem安装问题未声明标识符“isgrayimage”macbook m1

thigvfpy  于 2021-09-29  发布在  Java
关注(0)|答案(1)|浏览(544)

我在m1 macbook上安装rmagick gem时遇到问题。我通过brew安装了最新版本的imagemagick arch -arm64 brew install imagemagick 并使用以下命令对其进行了测试:
magick logo: logo.gif identify logo.gif 一旦我确认它工作正常,我就将rmagick gem添加到我的gem文件中。下面是 bundle install 指挥部。

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/user/.rvm/gems/ruby-2.7.2/gems/rmagick-4.2.2/ext/RMagick
/Users/user/.rvm/rubies/ruby-2.7.2/bin/ruby -I /Users/user/.rvm/rubies/ruby-2.7.2/lib/ruby/site_ruby/2.7.0 -r ./siteconf20210721-75512-tve65x.rb extconf.rb
checking for brew... yes
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... yes
checking for forced use of ImageMagick 6... no
checking for outdated ImageMagick version (<= 6.7.7)... no
checking for gcc... yes
checking for __GNUC__... yes
checking for MagickCore/MagickCore.h... yes
checking for rb_gc_adjust_memory_usage() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,sys/types.h,MagickCore/MagickCore.h... yes
checking for posix_memalign() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,sys/types.h,MagickCore/MagickCore.h... yes
checking for malloc_usable_size() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,sys/types.h,MagickCore/MagickCore.h... no
checking for malloc_size() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,sys/types.h,MagickCore/MagickCore.h... yes
checking for _aligned_msize() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,sys/types.h,MagickCore/MagickCore.h... no
checking for GetImageChannelEntropy() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,sys/types.h,MagickCore/MagickCore.h... no
checking for SetImageGray() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,sys/types.h,MagickCore/MagickCore.h... no
checking for SetMagickAlignedMemoryMethods() in assert.h,ctype.h,stdio.h,stdlib.h,math.h,time.h,sys/types.h,MagickCore/MagickCore.h... no
checking for malloc.h... no
checking for malloc/malloc.h... yes
creating extconf.h
creating Makefile
======================================================================
Wed 21 Jul 21 07:25:56
This installation of RMagick 4.2.2 is configured for
Ruby 2.7.2 (x86_64-darwin20) and ImageMagick 7.1.0
======================================================================

Configured compile options: {:magick_version=>"7.1.0", :local_libs=>" -L/opt/homebrew/Cellar/imagemagick/7.1.0-4_1/lib -lMagickCore-7.Q16HDRI", :cflags=>" -Xpreprocessor -fopenmp
-DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/homebrew/Cellar/imagemagick/7.1.0-4_1/include/ImageMagick-7 -std=gnu99", :cppflags=>" -Xpreprocessor -fopenmp
-DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/homebrew/Cellar/imagemagick/7.1.0-4_1/include/ImageMagick-7", :ldflags=>"
-L/opt/homebrew/Cellar/imagemagick/7.1.0-4_1/lib -lMagickCore-7.Q16HDRI", :defs=>[], :config_h=>"Makefile"}

current directory: /Users/user/.rvm/gems/ruby-2.7.2/gems/rmagick-4.2.2/ext/RMagick
make DESTDIR\= clean

current directory: /Users/user/.rvm/gems/ruby-2.7.2/gems/rmagick-4.2.2/ext/RMagick
make DESTDIR\=
compiling rmagick.c
compiling rmdraw.c
compiling rmenum.c
compiling rmfill.c
compiling rmilist.c
compiling rmimage.c
rmimage.c:7552:32: error: use of undeclared identifier 'IsGrayImage'
    return has_attribute(self, IsGrayImage);
                               ^
1 error generated.
make:***[Makefile:245: rmimage.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.7.2/gems/rmagick-4.2.2 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.7.2/extensions/x86_64-darwin-20/2.7.0/rmagick-4.2.2/gem_make.out

An error occurred while installing rmagick (4.2.2), and Bundler cannot continue.
Make sure that `gem install rmagick -v '4.2.2' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  rmagick
wvmv3b1j

wvmv3b1j1#

确保您的ruby、rmagick和imagemagick都是64位或32位。这就是我在Windows10上的问题(请参阅您回复的github帖子)。

相关问题