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++

The Definitive Guide to CentOS (Books for Professionals by Professionals) (Paperback)

By (author): Peter Membrey, Tim Verhoeven, Ralph Angenendt


List Price: $39.99 USD
New From: $23.41 USD In Stock
Used from: $17.37 USD In Stock


List Price: $42.99 USD
New From: $25.33 USD In Stock
Used from: $22.99 USD In Stock

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , , , , ,
4 Responses to “CentOS 5: make: g++: Command not found”
  1. smith says:

    yum install gcc-c++

    [Reply]

    alex Reply:

    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]

  2. Nik says:

    Thank you, this did the trick.

    [Reply]

    alex Reply:

    Hello Nik,

    No problem. Thanks for taking the time to leave feedback.

    Thanks.
    alex

    [Reply]

  3.  
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.

*