gpt4 book ai didi

amazon-ec2 - Eventmachine 1.2.7 构建在 Amazon Linux AMI 上使用 Ruby 2.5.1 失败 - "rhel fedora"

转载 作者:太空宇宙 更新时间:2023-11-03 17:15:34 25 4
gpt4 key购买 nike

在 Amazon linux ami 上安装 eventmachine gem 时遇到问题,在 ruby​​-2.3.6 上工作正常,在 ruby​​-2.5.1 上中断
步骤:
gem install eventmachine

注意:gcc 版本 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)
错误日志:

Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
current directory: /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/eventmachine-1.2.7/ext
/home/ec2-user/.rvm/rubies/ruby-2.5.1/bin/ruby -r ./siteconf20180724-
3006-y7es83.rb extconf.rb
checking for -lcrypto... yes
checking for -lssl... yes
checking for openssl/ssl.h... yes

checking for CLOCK_MONOTONIC in time.h... yes
CXXFLAGS=$(cxxflags)

creating Makefile
current directory: /home/ec2-user/.rvm/gems/ruby 2.5.1/gems/eventmachine-1.2.7/ext
make "DESTDIR=" clean
current directory: /home/ec2-user/.rvm/gems/ruby-
2.5.1/gems/eventmachine-1.2.7/ext
make "DESTDIR="

compiling binder.cpp
g++: error: unrecognized command line option ‘-Wmisleading-indentation’
g++: error: unrecognized command line option ‘-Wimplicit-fallthrough=0’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wrestrict’

make: *** [binder.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/ec2-user/.rvm/gems/ruby-2.5.1/gems/eventmachine-1.2.7 for inspection.
Results logged to /home/ec2-user/.rvm/gems/ruby-2.5.1/extensions/x86_64-linux/2.5.0/eventmachine-1.2.7/gem_make.out

最佳答案

这似乎是 AWS 内核更新后 AWS 上的 gcc 和 g++ 版本不匹配的根本原因。解决方案是运行:

sudo yum remove gcc48-c++
sudo yum install gcc72-c++

参见 https://github.com/cowboyd/therubyracer/issues/446

关于amazon-ec2 - Eventmachine 1.2.7 构建在 Amazon Linux AMI 上使用 Ruby 2.5.1 失败 - "rhel fedora",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51513271/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com