You might see this error when attempting to install various packages or gems on CentOS Linux. I noticed it when attempting to install the ruby gem named eventmachine. After installing one RPM package via yum I no longer received the error when attempting to install the eventmachine gem.
EventMachine Gem Install Error Noticed:
[root@server]# gem install eventmachine Building native extensions. This could take a while... ERROR: Error installing eventmachine: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb install eventmachine checking for main() in -lpthread... yes checking for sys/epoll.h... yes checking for rb_thread_blocking_region()... no checking for main() in -lcrypto... yes checking for main() in -lssl... yes checking for main() in -lcrypto... yes checking for openssl/ssl.h... yes checking for openssl/err.h... yes creating Makefile make g++ -I. -I. -I/usr/local/lib/ruby/1.8/i686-linux -I. -DHAVE_SYS_EPOLL_H -DHAVE_OPENSSL_SSL_H -DHAVE_OPENSSL_ERR_H -I/include/include -DOS_UNIX -DBUILD_FOR_RUBY -DHAVE_EPOLL -DWITH_SSL -fPIC -g -O2 -c binder.cpp make: g++: Command not found make: *** [binder.o] Error 127 Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/ext/gem_make.out
Just install the gcc-c++ package via yum as shown below. After installing the gcc-c++ RPM package you should be able to now install the eventmachine gem without issue.
Install gcc-c++ Package Using Yum On CentOS Linux:
Install Command: yum install gcc-c++
|
|
|
|




Entries (RSS)
yum install gcc-c++
[Reply]
alex Reply:
March 8th, 2010 at 3:57 PM
Hello smith,
Thanks for taking the time to leave feedback. Installing the gcc-c++ RPM package was noted in the article though the article format made it hard to read. I have since updated the article to QD’s new format and it should be much easier for others to find the solution.
Thanks.
alex
[Reply]
Thank you, this did the trick.
[Reply]
alex Reply:
September 8th, 2011 at 6:38 PM
Hello Nik,
No problem. Thanks for taking the time to leave feedback.
Thanks.
alex
[Reply]