由于unf_ext(0.0.5)gem,捆绑安装失败

时间:2012-12-12 08:49:21

标签: ruby-on-rails-3.2 bundle-install

我安装了ruby 1.9.3p327& rails 3.2.8在centos 6.3上使用rvm。但是在为特定项目文件夹执行bundle安装时,该过程在尝试安装gem unf_ext 0.0.5并抛出跟随错误时失败,

使用本机扩展安装unf_ext(0.0.5) Gem :: Installer :: ExtensionBuildError:错误:无法构建gem原生扩展。

/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文件将保留在/home/rradmin/.rvm/gems/ruby-1.9.3-p327@r32/gems/unf_ext-0.0.5中进行检查。 结果登录到/home/rradmin/.rvm/gems/ruby-1.9.3-p327@r32/gems/unf_ext-0.0.5/ext/unf_ext/gem_make.out

  

安装unf_ext(0.0.5)时发生错误,而Bundler则不能   继续。确保gem install unf_ext -v '0.0.5'成功   在捆绑之前。

我也尝试过如上所述单独安装unf_ext,但是出现了同样的错误。 我提到了https://github.com/cowboyd/therubyracer/issues/135,但仍无法解决问题。请让我知道解决这个问题的正确方法。

谢谢。

4 个答案:

答案 0 :(得分:19)

在Ubuntu上我只需要做

sudo apt-get install build-essential

解决这个问题。

(我记录的是新建的Ubuntu 12.10服务器X64)

答案 1 :(得分:1)

如果您没有支持库来编译gem尝试安装以下软件包

,则会出现此错误
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

然后进行捆绑安装

答案 2 :(得分:0)

谢谢苏曼。但我通过使用yum install gcc-g ++ libstdc ++ - devel安装 libstdc ++ - devel 解决了这个问题。

答案 3 :(得分:0)

我使用 .sideImage { width: 300px; height: 180px; } .slideshow { position: relative; height: 220px; } .slideshow figure { position: absolute; opacity: 1; margin-left: -20px; width: 300px; height: 220px; overflow: hidden; } .slideshow figure:nth-child(2) { animation: xfade 36s 0s infinite; -moz-animation: xfade 36s 0s infinite; -webkit-animation: xfade 36s 0s infinite; -o-animation: xfade 36s 0s infinite; } .slideshow figure:nth-child(3) { animation: xfade 36s 6s infinite; -moz-animation: xfade 36s 6s infinite; -webkit-animation: xfade 36s 6s infinite; -o-animation: xfade 36s 6s infinite; } .slideshow figure:nth-child(4) { animation: xfade 36s 12s infinite; -moz-animation: xfade 36s 12s infinite; -webkit-animation: xfade 36s 12s infinite; -o-animation: xfade 36s 12s infinite; } .slideshow figure:nth-child(5) { animation: xfade 36s 18s infinite; -moz-animation: xfade 36s 18s infinite; -webkit-animation: xfade 36s 18s infinite; -o-animation: xfade 36s 18s infinite; } .slideshow figure:nth-child(6) { animation: xfade 36s 24s infinite; -moz-animation: xfade 36s 24s infinite; -webkit-animation: xfade 36s 24s infinite; -o-animation: xfade 36s 24s infinite; } .slideshow figure:nth-child(7) { animation: xfade 36s 30s infinite; -moz-animation: xfade 36s 30s infinite; -webkit-animation: xfade 36s 30s infinite; -o-animation: xfade 36s 30s infinite; } <table><tr><td width="400px"> <div id="KekoaTextBox" color="#161447"><h3><strong>This site is a resource for the language industry, including translation, interpretation, and localization. Also, check here and our <a href="https://www.facebook.com/groups/689448181135760/">Facebook page</a> to stay up to date on club events. Club meetings are Thursdays at 11 AM!</strong></h3></div> </div></td><td width="300px"><div class="slideshow"> <figure><img src="http://l10n.byu.edu/files/2015/03/IMG_0020-225x300.jpg" alt="Trados Dylan" class=" sideImage" /></figure> <figure><img src="http://l10n.byu.edu/files/2014/11/Screen-Shot-2015-02-04-at-2.44.27-PM-300x223.png" alt="Benjamin Dowdy" width="300" height="223" class=" sideImage" /></figure><figure><img src="http://l10n.byu.edu/files/2015/02/IMG_20150212_112128_4651-300x225.jpg" alt="IMG_20150212_112128_465[1]" class=" sideImage" /></figure><figure><img src="http://l10n.byu.edu/files/2015/01/ClubFlier-300x225.jpg" alt="Opening Flier" width="300" height="225" class=" sideImage" /></figure><figure><img src="http://l10n.byu.edu/files/2014/12/BYU_campus_dark_winter-300x128.jpg" alt="BYU campus at night" width="300" height="128" class=" sideImage" /></figure><img src="http://l10n.byu.edu/files/2015/02/IMG_20150212_112215_0601-300x169.jpg" alt="Trados training" class=" sideImage" /></figure></div></td></tr> <tr><td>[widgets_on_pages]</td> </tr></table>

安装 libstdc ++ - devel 解决了这个问题