rubygem "Argument list too long"

Posted by mehmermaid on Stack Overflow See other posts from Stack Overflow or by mehmermaid
Published on 2011-03-03T17:08:32Z Indexed on 2011/03/05 23:25 UTC
Read the original article Hit count: 317

Filed under:

My problem is that during or after running a process which uses Ruby intensively, when I use any gem command including gem --version or gem install rake, it hangs for just over a minute and then gives me this error:

$ gem list
/Users/username/.rvm/bin/gem: line 5: /Users/username/.rvm/bin/gem: Argument list too long
/Users/username/.rvm/bin/gem: line 5: /Users/username/.rvm/bin/gem: Unknown error: 0

file at : line 5: /Users/username/.rvm/bin/gem

#!/usr/bin/env bash

if [[ -s "/Users/username/.rvm/environments/ruby-1.8.7-p334" ]] ; then
  source "/Users/username/.rvm/environments/ruby-1.8.7-p334"
  exec gem "$@"                # this is line 5
else
  echo "ERROR: Missing RVM environment file: '/Users/username/.rvm/environments/ruby-    1.8.7-p334'" >&2
exit 1
fi

The only way that I have found to get this working again is to restart my computer, which is obviously undesirable. I am using OSX 10.6.5

I have spent quite a while trying to find anyone else who has had this problem, and been unsuccessful. Do you have any idea why this might be happening?

© Stack Overflow or respective owner

Related posts about rubygems