2

I have read many posts about this error, but I can't seem to figure anything out. For some reason all my rails apps are seeing this error when I run just about anything on the command line (rails s, gem list, sudo gem update --system, etc.)

/Users/username/.rvm/bin/gem: line 6: /Users/username/.rvm/bin/gem: Argument list too long

/Users/username/.rvm/bin/gem: line 6: /Users/username/.rvm/bin/gem: Unknown error: 0

The file it points to looks like this:

#!/usr/bin/env bash

if [[ -s "/Users/username/.rvm/environments/ruby-1.9.2-p180@rails31" ]]
then
  source "/Users/username/.rvm/environments/ruby-1.9.2-p180@rails31"
  exec gem "$@" #The line it points at
else
  echo "ERROR: Missing RVM environment file: '/Users/username/.rvm/environments/ruby- 1.9.2-p180@rails31'" >&2
  exit 1
fi

I'm really new to rails so maybe this is something simple, but I can't make anything of it.

UPDATE:

I reinstalled rvm, but now i get a new error. I was trying to install a different version of ruby and it was all going ok until:

ERROR: Error running ' ./configure --prefix="/Users/username/.rvm/usr"  ', please read /Users/username/.rvm/log/ruby-1.9.2-p180/yaml/configure.log
Compiling yaml in /Users/username/.rvm/src/yaml-0.1.3.
ERROR: Error running '/usr/bin/make ', please read /Users/username/.rvm/log/ruby-1.9.2-p180/yaml/make.log
Installing yaml to /Users/username/.rvm/usr
ERROR: Error running '/usr/bin/make install', please read /Users/username/.rvm/log/ruby-1.9.2-p180/yaml/make.install.log
ruby-1.9.2-p180 - #configuring 
ERROR: Error running ' ./configure --prefix=/Users/username/.rvm/rubies/ruby-1.9.2-p180 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/username/.rvm/usr ', please read /Users/username/.rvm/log/ruby-1.9.2-p180/configure.log
ERROR: There has been an error while running configure. Halting the installation.
Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
Rymo4
  • 461
  • 2
  • 7
  • 15
  • can you verify which ruby version you are using with `ruby -v` in the console? – thenengah Jun 26 '11 at 21:02
  • If you're using rvm, you don't ever want to type in "sudo" -- do you get the errors with non-sudo? – Jesse Wolgamott Jun 26 '11 at 23:02
  • ruby -v and the non-sudo both give me an error too. – Rymo4 Jun 26 '11 at 23:11
  • wow, ruby itself gives this error? That's kind of disturbing. – jaydel Jun 27 '11 at 00:49
  • 2
    please reformat your output and then add the relevant errormessages from the logs that are mentionend in there! – phoet Jan 24 '12 at 14:37
  • Pastie /Users/username/.rvm/log/ruby-1.9.2-p180/configure.log - or put it here. – Reactormonk Jan 24 '12 at 14:53
  • I would guess that you're missing a build dependency of some sort. The logs should tell. – Wolfram Arnold Jan 31 '12 at 02:52
  • This probably should have been two questions; your original "argument list too long" error message has a different solution from your second "error while running configure" error. – sarnold Feb 18 '12 at 01:02
  • Perhaps it's related to GCC? This post might help: http://stackoverflow.com/a/8032980/747923 – twmills Jan 25 '12 at 17:41
  • @sarnold I had the same two issue as Rymo4- 1. I had to reinstall RVM, `rvm implode` 2.Then got the same installation process halting because 1.9.3-p0 expects a non-LLVM version of GCC, which is no longer included in XCode form version 4.2. `rvm install 1.9.3-p0 --with-gcc=clang` – amosel Feb 20 '12 at 17:39
  • @amosel: please add that as an answer -- it covers content not yet answered. (And even though Jesse's answer gets Rymo4 a little further, "remove all your configuration" can usually be improved upon. :) – sarnold Feb 20 '12 at 22:58

4 Answers4

4

From the answer's comments:

  1. reinstall RVM, rvm implode
  2. Then got the same installation process halting because 1.9.3-p0 expects a non-LLVM version of GCC, which is no longer included in XCode form version 4.2. rvm install 1.9.3-p0 --with-gcc=clang
Pedro Rolo
  • 28,273
  • 12
  • 60
  • 94
  • 1
    I was trying to install RVM, Ruby and Rails for about a full week with an uncanny amount (probably close to 100) different errors that no amount of debugging or reinstallation could fix. The --with-gcc=clang flag was exactly what I needed. I can't thank you enough for your answer. So, this is the best I can do: THANK YOU FROM THE BOTTOM OF MY HEART YOU WONDERFUL MAN! – RileyE Mar 07 '13 at 20:51
2

Reinstalling RVM helped me with this issue.

rvm implode
    bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
tmjam
  • 1,029
  • 2
  • 12
  • 25
1

I ran into a similar problem before when I installed RVM (or parts of it) using sudo.

What worked for me was to remove all .rvm from your user's folder, and re-install using non-sudo.

Jesse Wolgamott
  • 40,197
  • 4
  • 83
  • 109
  • This is what i did to get rid of that error... but now I get something new. I'll add it to the original question – Rymo4 Jun 27 '11 at 03:16
0

create a .rvmrc for your project using an up to date version of ruby or try rvm use 1.9.3

random-forest-cat
  • 33,652
  • 11
  • 120
  • 99