问题
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.
回答1:
On Ubuntu I only needed to do
sudo apt-get install build-essential
to fix this.
(for the record I'm on a freshly-built Ubuntu 12.10 Server X64)
回答2:
This error comes when you don't have supporting libraries to compile the gem try to install the following packages
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
then do a bundle install
回答3:
Thanks Suman. But I resolved the issue by installing libstdc++-devel using yum install gcc-g++ libstdc++-devel.
回答4:
I resolved the issue by installing libstdc++-devel using yum install gcc-c++ libstdc++-devel
来源:https://stackoverflow.com/questions/13835950/bundle-install-failed-due-to-unf-ext-0-0-5-gem