Rymo4
Rymo4

Reputation: 471

Argument list too long in Rails

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.

Upvotes: 2

Views: 6072

Answers (4)

random-forest-cat
random-forest-cat

Reputation: 35974

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

Upvotes: 0

tmjam
tmjam

Reputation: 1039

Reinstalling RVM helped me with this issue.

rvm implode
    bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)

Upvotes: 2

Pedro Rolo
Pedro Rolo

Reputation: 29970

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

Upvotes: 4

Jesse Wolgamott
Jesse Wolgamott

Reputation: 40277

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.

Upvotes: 1

Related Questions