title: Ruby gems bundle install failure
body: <p>I am installing Diaspora (open source social networking) in Ubuntu 16.04 using <a href="https://wiki.diasporafoundation.org/Installation/Ubuntu/Xenial" rel="nofollow noreferrer">these directions</a>.  Installation instructions call for using Ruby Version Manager to install Ruby and then using Bundler to add some required gems.  Ruby installs, then the command to use the bundler</p>
  
  <pre><code>:~/diaspora$ bin/bundle install --full-index
  </code></pre>
  
  <p>makes some progress and then fails at this step:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I updated to gcc-7 and g++-7, and appear to be using them:</p>
  
  <pre><code>:~/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
  </code></pre>
  
  <p>I also successfully installed unf_ext without Bundler using</p>
  
  <pre><code>:~/diaspora$ gem install unf_ext -v '0.0.7.4'
  </code></pre>
  
  <p>and it is there:</p>
  
  <pre><code>:~/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)
  </code></pre>
  
  <p>... but the same error persists.</p>
  
  <p>Looking to understand the source of the error and how to resolve.</p>