在Windows 10的ubuntu 20.04 WSL上安装rmagick gem

时间:2020-09-19 13:08:55

标签: ruby-on-rails ruby ubuntu windows-subsystem-for-linux

我正在Windows 10的ubuntu 20.04 WSL上安装rmagick gem,出现以下错误

make "DESTDIR="
compiling rmagick.c
compiling rmdraw.c
compiling rmenum.c
compiling rmfill.c
compiling rmilist.c
compiling rmimage.c
rmimage.c: In function ‘Image_gray_q’:
rmimage.c:7552:32: error: ‘IsGrayImage’ undeclared (first use in this function); did you mean ‘DrawImage’?
 7552 |     return has_attribute(self, IsGrayImage);
      |                                ^~~~~~~~~~~
      |                                DrawImage
rmimage.c:7552:32: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:245: rmimage.o] Error 1

make failed, exit code 2

请帮忙

2 个答案:

答案 0 :(得分:0)

请尝试安装libMagickWand

sudo apt-get install libmagickwand-dev 

rmagic github issue

答案 1 :(得分:0)

安装新版本似乎可以,请尝试7.0.10-33。

原因是早期版本中存在一些混合的编译标志,有关详细信息,请参见github.com/rmagick/rmagick/issues/1228