I have installed ruby 1.9.3p327 & rails 3.2.8 using rvm on centos 6.3. But while doing bundle install for a particular project folder, the process fails in between when it tries to install gem unf_ext 0.0.5 and throws following error,
Installing unf_ext (0.0.5) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/rradmin/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb -fPIC
checking for main() in -lstdc++... yes
checking for ruby/encoding.h... yes
creating Makefile
make
compiling unf.cc
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/vector:61,
from unf/normalizer.hh:4,
from unf.cc:1:
.....
....
...
Gem files will remain installed in /home/rradmin/.rvm/gems/ruby-1.9.3-p327@r32/gems/unf_ext-0.0.5 for inspection. Results logged to /home/rradmin/.rvm/gems/ruby-1.9.3-p327@r32/gems/unf_ext-0.0.5/ext/unf_ext/gem_make.out
An error occurred while installing unf_ext (0.0.5), and Bundler cannot continue. Make sure that
gem install unf_ext -v '0.0.5'
succeeds before bundling.
I also tried to install unf_ext separately as mentioned above, but got the same error. I have referred https://github.com/cowboyd/therubyracer/issues/135, but still not able to solve the problem. Please let me know proper way to solve this problem.
Thank you.
Thanks Suman. But I resolved the issue by installing libstdc++-devel using yum install gcc-g++ libstdc++-devel.