6
7

More than 5 years have passed since last update.

[Rails 4.x] bundle install 時に起きたエラーの対処

Posted at

Gemfileをイジイジして、bundle install叩いたら以下のエラーが出た。
状況としては、git pullしようとしたら、事前にmergeしてくださいと出て、
めんどくさいからGemfileとGemfile.lockをcheckoutしたという感じです。

vagrant-hoge hoge$ bundle install

Fetching source index from https://rubygems.org/
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!

/home/hoge/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/bundler-1.6.2/lib/bundler/source/git/git_proxy.rb:114:in ``': Cannot allocate memory - git (Errno::ENOMEM)
・
・
・

指示通り、http://bit.ly/bundler-issues にアクセスしたら解決法が書いてあった。

# remove user-specific gems and git repos
$ rm -rf ~/.bundle/ ~/.gem/bundler/ ~/.gems/cache/bundler/

# remove system-wide git repos and git checkouts
$ rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/

# remove project-specific settings
$ rm -rf .bundle/

# remove project-specific cached gems and repos
rm -rf vendor/cache/

# remove the saved resolve of the Gemfile
rm -rf Gemfile.lock

# uninstall the rubygems-bundler and open_gem gems
$ rvm gemset use global # if using rvm
$ gem uninstall rubygems-bundler open_gem

# try to install one more time
$ bundle install

とりあえずこの通りにやってみたらうまくいきました。

ネットをあさると他の解決策も載っていましたが、わたしの場合はこれで解決しました。

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7