Rails Vagrant,Ubuntu 下 执行 bundle install 出错!原来在 Ubuntu 下也没用这样的错误!

shangrenzhidao · November 12, 2013 · Last by leopku replied at November 12, 2013 · 3943 hits
root@vagrant-ubuntu-raring-64:/home/vagrant/eol-master# gem install bundler
Successfully installed bundler-1.3.5
1 gem installed
root@vagrant-ubuntu-raring-64:/home/vagrant/eol-master# bundle install
Fetching source index from https://rubygems.org/
Fetching git://github.com/pleary/octopus.git
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:88:in ``': Cannot allocate memory - git clone 'git://github.com/pleary/octopus.git' "/usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/cache/bundler/git/octopus-9c72404373193704ea6fac9249dbb7dac8a5cbf7" --bare --no-hardlinks (Errno::ENOMEM)
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:88:in `git'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/source/git/git_proxy.rb:49:in `checkout'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/source/git.rb:144:in `specs'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/lazy_specification.rb:52:in `__materialize__'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/spec_set.rb:88:in `block in materialize'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `map!'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/spec_set.rb:85:in `materialize'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/bin/bundle:20:in `block in <top (required)>'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/gems/bundler-1.3.5/bin/bundle:20:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/bin/bundle:23:in `load'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/bin/bundle:23:in `<main>'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/bin/ruby_executable_hooks:15:in `eval'
        from /usr/local/rvm/gems/ruby-1.9.3-p392@upgrade/bin/ruby_executable_hooks:15:in `<main>'

你这个 vagrant 里都跑了些啥? 貌似内存不够了

会不会是 VirtualBox 的 bug?看不明白,猜测的。

#1 楼 @leopku redis, webrick solr, 很大一个项目,eol.org 你看看这个网站,那么我想问你可以直接使用 virtualboxi 为为虚拟机分配更大内存吗?该如何操作

#2 楼 @lgn21st 恩,我是先把源码从 git 上拿下来,再去安装的

#1 楼 @leopku 我可以用 vagrant 管理已安装完的虚拟系统吗?

#3 楼 @shangrenzhidao 可以,两种方法。

  1. 打开 Vagrantfile,在 config 里加上
config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--memory", "1024"]
end
  1. 打开 VirtualBox 管理器,然后怎么设置就简单了。

推荐第 1 种方法

You need to Sign in before reply, if you don't have an account, please Sign up first.