Ruby gems捆绑安装失败

时间:2018-02-22 21:54:53

标签: ruby rubygems bundler

我正在使用these directions在Ubuntu 16.04中安装Diaspora(开源社交网络)。安装说明要求使用Ruby Version Manager安装Ruby,然后使用Bundler添加一些必需的gem。 Ruby安装,然后命令使用bundler

:~/diaspora$ bin/bundle install --full-index

取得一些进展,然后在此步骤失败:

Fetching unf_ext 0.0.7.4
Installing unf_ext 0.0.7.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    current directory:/home/ubuntu/diaspora/vendor/bundle/ruby/2.4.0/gems/unf_ext-0.0.7.4/ext/unf_ext
/home/ubuntu/.rvm/rubies/ruby-2.4.1/bin/ruby -r ./siteconf20180215-26943-187isn6.rb extconf.rb
checking for -lstdc++... yes
creating Makefile

current directory: /home/ubuntu/diaspora/vendor/bundle/ruby/2.4.0/gems/unf_ext-0.0.7.4/ext/unf_ext
make "DESTDIR=" clean

current directory: /home/ubuntu/diaspora/vendor/bundle/ruby/2.4.0/gems/unf_ext-0.0.7.4/ext/unf_ext
make "DESTDIR="
compiling unf.cc
cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++
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++
virtual memory exhausted: Cannot allocate memory
Makefile:209: recipe for target 'unf.o' failed
make: *** [unf.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/ubuntu/diaspora/vendor/bundle/ruby/2.4.0/gems/unf_ext-0.0.7.4 for inspection.
Results logged to /home/ubuntu/diaspora/vendor/bundle/ruby/2.4.0/extensions/x86_64-linux/2.4.0/unf_ext-0.0.7.4/gem_make.out

An error occurred while installing unf_ext (0.0.7.4), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.4'` succeeds before bundling.

In Gemfile:
  asset_sync was resolved to 2.2.0, which depends on
     unf was resolved to 0.1.4, which depends on
        unf_ext

我更新了gcc-7和g ++ - 7,似乎正在使用它们:

:~/diaspora$ update-alternatives --display gcc
gcc - auto mode
  link best version is /usr/bin/gcc-7
  link currently points to /usr/bin/gcc-7
  link gcc is /usr/bin/gcc
/usr/bin/gcc-7 - priority 10
:~/diaspora$ update-alternatives --display g++
g++ - auto mode
  link best version is /usr/bin/g++-7
  link currently points to /usr/bin/g++-7
  link g++ is /usr/bin/g++
/usr/bin/g++-7 - priority 10

我还使用

成功安装了没有Bundler的unf_ext
:~/diaspora$ gem install unf_ext -v '0.0.7.4'

它就在那里:

:~/diaspora$ gem list

*** LOCAL GEMS ***

bigdecimal (default: 1.3.0)
bundler (default: 1.16.1)
bundler-unload (1.0.2)
did_you_mean (1.1.0)
executable-hooks (1.3.2)
gem-wrappers (1.3.2, 1.2.7)
io-console (default: 0.4.6)
json (default: 2.0.2)
minitest (5.10.1)
net-telnet (0.1.1)
openssl (default: 2.0.3)
power_assert (0.4.1)
psych (default: 2.2.2)
rake (12.0.0)
rdoc (default: 5.0.0)
rubygems-bundler (1.4.4)
rubygems-update (2.7.5, 2.6.14)
rvm (1.11.3.9)
test-unit (3.2.3)
unf_ext (0.0.7.5, 0.0.7.4, 0.0.7.2)
xmlrpc (0.2.1)

...但同样的错误仍然存​​在。

希望了解错误的来源以及如何解决。

1 个答案:

答案 0 :(得分:1)

安装过程中你的盒子内存不足:

virtual memory exhausted: Cannot allocate memory

它正在杀死安装。你应该增加你的系统内存。