0
votes

I am trying to install gem res-client in my redhat linux server.Installed whatever dependencies i found but still not working for me.

Ruby Version:

ruby 2.3.6p384 (2017-12-14 revision 61254) [x86_64-linux]

[root@feeds ]# gem install rest-client

Building native extensions. This could take a while...

ERROR: Error installing rest-client:

ERROR: Failed to build gem native extension.

current directory: /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/unf_ext-0.0.7.6/ext/unf_ext

/opt/rh/rh-ruby23/root/usr/bin/ruby -I /opt/rh/rh-ruby23/root/usr/local/share/ruby/site_ruby -r ./siteconf20190429-62674-e4of20.rb extconf.rb

checking for main() in -lstdc++... no creating Makefile

current directory: /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/unf_ext- 0.0.7.6/ext/unf_ext

make "DESTDIR=" clean

rm -f

rm -f unf_ext.so *.o .bak mkmf.log ..time

current directory: /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/unf_ext-0.0.7.6/ext/unf_ext

make "DESTDIR=" g++ -I. -I/opt/rh/rh-ruby23/root/usr/include -I/opt/rh/rh-ruby23/root/usr/include/ruby/backward -I/opt/rh/rh-ruby23/root/usr/include -I. -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -mtune=generic -m64 -o unf.o -c unf.cc

make: g++: Command not found

make: *** [unf.o] Error 127

make failed, exit code 2

Gem files will remain installed in /opt/rh/rh-ruby23/root/usr/local/share/gems/gems/unf_ext-0.0.7.6 for inspection. Results logged to /opt/rh/rh-ruby23/root/usr/local/lib64/gems/ruby/unf_ext-0.0.7.6/gem_make.out

Can anyone please suggest.

Thanks Sina

3

3 Answers

0
votes

It looks like you are missing the gcc-c++ compiler. Install it with:

yum install gcc-c++
0
votes

build-essential g++ are the missing ones. So try installing:

yum install build-essential g++

then install the required gem:

gem install rest-client

hope it helps....

0
votes

Thanks .

I reinstall ruby and dependencies then it worked.

Regards,

Sina