在Amezon AMI服务器上安装rmagick gem时,ImageMagick依赖项出错



构建本机扩展。这可能需要一段时间。。。错误:安装rmagick时出错:错误:无法构建gem本机扩展。

current directory: /home/ec2-user/.rvm/gems/ruby-2.6.5/gems/rmagick-4.2.2/ext/RMagick

/home/ec2 user/.rvm/rubies/ruby-2.6.5/bin/ruby-I/home/ec2 user/.rvm-rubies/rubey-2.6.5/lib/ruby/site_ruby/2.6.0-r/siteconf20210806-10706-10mubyf.rb extconf.rb正在检查啤酒。。。不正在检查pacman。。。不检查Ruby版本>=2.3.0…是正在检查pkg配置。。。对正在检查过时的ImageMagick版本(<=6.7.7(…否正在检查gcc。。。对检查GNUC…***extconf.rb失败***由于某些原因,无法创建Makefile,可能缺少必要的库和/或标头。有关详细信息,请查看mkmf.log文件。你可以需要配置选项。

提供的配置选项:--带opt-dir--不带opt-dir--带有opt-include--不带opt-include=${opt-dir}/include--使用opt-lib--不带opt-lib=${opt-dir}/lib--使用make prog--没有make prog--srcdir=。--curdir--ruby=/home/ec2 user/.rvm/rubies/ruby-2.6.5/bin/$(ruby_BASE_NAME(/home/ec2 user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:467:在try_compile'中的try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:585:in块中来自/home/ec2 user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:534:在with_werror' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:585:intry_compile'中来自/home/ec2 user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:852:在have_macro中的macro_defined?' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:994:in块中来自/home/ec2 user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:959:在延迟中的block in checking_for' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:361:in块(2级(中来自/home/ec2 user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:331:在延迟中的open' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:361:in块中来自/home/ec2 user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:331:在open' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:357:in中推迟'来自/home/ec2 user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:958:在checking_for' from /home/ec2-user/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/mkmf.rb:993:inhave_macro'中来自extconf.rb:99:inconfigure_compile_options' from extconf.rb:19:ininitialize'来自extconf.rb:398:在new' from extconf.rb:398:in'中

要了解此扩展无法编译的原因,请查看mkmf.log,它可以在以下位置找到:

/home/ec2 user/.rvm/gems/ruby-2.6.5/extensions/x86_64-linux/2.6.0/rmagick-4.2.2/kmf.log

extconf失败,退出代码1

Gem文件将保持安装在/home/ec2 user/.rvm/gems/ruby-2.6.5/gems/rmagick-4.2.2中进行检查。结果记录到/home/ec2 user/.rvm/gems/ruby-2.6.5/extensions/x86_64-linux/2.6.0/rmagick-4.2.2/gem_make.out

  1. sudo yum-y安装ImageMagick-ImageMagick-devel
  2. convert-version输出:

版本:ImageMagick 6.9.10-68 Q16 x86_64 2021-02-03https://imagemagick.org版权所有:©1999-2019 ImageMagick Studio LLC许可证:https://imagemagick.org/script/license.php特点:密码DPC模块OpenMP(3.1(委托(内置(:bzlib fontconfig freetype gslib jng jpeg lcms ltdl lzma png ps tiff wmf x xml zlib3.gem安装rmagick如果你仍然得到错误遵循以下命令

  1. sudo ln-s/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgomp.spec/usr/lib64/libgomp.spec
  2. sudo ln-s/usr/lib/gcc/x86_64-amazon-linux/4.8.5/libgomp.a/usr/lib64/libgomp.a
  3. sudo ln-s/usr/lib64/libgomp.so1.0.0/usr/lib64/liggomp.so然后再次运行geminstall-ragick,一切都完成了

您可以在下面找到链接https://senrenseyo.com/20210811/rails6_rmagick/

相关内容

  • 没有找到相关文章

最新更新