So I was messing with gemsets with a friend of mine and I accidentally deleted a one. I wasn't sure what happened, so I just kinda brushed it off.
Then I went to run 'rails server' for my old app that I've been working on and nothing happens for like 2 minutes and then finally it spits out an error.
/Users/Nick/.rvm/bin/ruby: line 6: /Users/Nick/.rvm/bin/ruby: Argument list too long
/Users/Nick/.rvm/bin/ruby: line 6: /Users/Nick/.rvm/bin/ruby: Undefined error: 0
So then I did everything suggested below and I've gotten all kinds of errors. If I were to create a seperate question for every error I think I'd be making a mess of stackoverflow, so I want to give some kind of order to solving this here.
Right now I'm trying to backtrack and figure out what happened... Every time I run these different commands in an answer I'm changing things while I have no idea what's going on.
When I try to install a version of ruby I get this error:
apple-gcc42 is not available in PATH, try:
brew unlink apple-gcc42 && brew link apple-gcc42
and make sure that apple-gcc42 is available in your PATH:
which gcc-4.2
I read somewhere that installing xCode would solve this, so I installed it. Although I get the same error.
When I try to run the first suggestions from that error I get this:
Unlinking /usr/local/Cellar/apple-gcc42/4.2.1-5666.3... 0 links removed
Linking /usr/local/Cellar/apple-gcc42/4.2.1-5666.3... Warning: Could not link apple-gcc42.
Unlinking...
Error: Could not symlink file: /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/include/gcc
/usr/local/include is not writable. You should change its permissions.
When I run the second suggestions it returns
gcc-4.2 not found
Usually when I run 'ruby -v' or 'rails -v' it returns the version name. Now it just returns the exact same error as when I run 'rails s'
If I try to switch gemsets from default to global it says
To install do: 'rvm install ruby-1.9.3-p125'
But then if I try to install it I get the same gcc error.
When I try to install rails I get this error about installing libyaml, which I've installed like 10 times:
➜ app3 git:(add_food_servings) ✗ gem install rails
/Users/Nick/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/yaml.rb:4:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/Users/Nick/.rvm/rubies/ruby-2.0.0-
p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require':
dlopen(/Users/Nick/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin11.4.2/psych.bundle, 9): Library not loaded: /usr/local/opt/libyaml/lib/libyaml-0.2.dylib (LoadError)
Referenced from: /Users/Nick/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin11.4.2/psych.bundle
My question is... what's going on and how can I get back to where I was when I could run rails s and just work on my app in peace!? lol