首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Eventmachine 1.2.7在Amazon上使用Ruby2.5.1构建失败--“Eventmachine”

Eventmachine 1.2.7在Amazon上使用Ruby2.5.1构建失败--“Eventmachine”
EN

Stack Overflow用户
提问于 2018-07-25 07:33:35
回答 1查看 575关注 0票数 2

在Amazon ami上安装事件机gem时,面临一个问题,在ruby-2.3.6上运行良好,与ruby-2.5.1中断。

步骤:

gem install eventmachine

注:gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)

错误日志:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-14 16:18:42

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

代码语言:javascript
复制
sudo yum remove gcc48-c++
sudo yum install gcc72-c++

请参阅https://github.com/cowboyd/therubyracer/issues/446

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51513271

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档