Ruby Ruby Loops Ruby Loops Ruby Loops

john petroshius
PRO
john petroshius
Pro Student 146 Points

Ruby in my Mac terminal

this may be inappropriate, or unanswerable, but I thought I'd give a try here anyway...taking Ruby courses here, and sailing along...using my own Mac OS 10 terminal at times...then today I tried to install Rails...install went well until the end where it asked me if I wanted to overwrite a particular Ruby or Gem file (Can't remember which one)...I said NO since I didn't want to do something that might mess stuff up (ha)...then it said install had failed...now my terminal doesn't understand even very basic commands...doesn't recognize "ruby -v"...doesn't recognize nano...won't install home brew...only stuff I can do with it is cd and the like...any hint on what I could do to get my terminal back to square one?

Just don't worry and close your terminal. Whenever files try to override other files, most of the time it's safe. So don't worry about that. Also, if you ever use sudo, be very careful

john petroshius
john petroshius
Pro Student 146 Points

thanks for responding jason:)...but I did use sudo, since at first bash told me I didn't have permissions to install gems...anyway, I am still worrying, because after closing out terminal, and restarting the computer, I still can't access ruby anymore...yesterday, I could...so I think something is definitely wrong...

-johnP

Well, now you learnt your lesson. Only use sudo if you know what you're doing. By the way, sudo affects the whole computer, not just the current account you're logged into. Good luck solving the issue.

A possible reason for this could be a misconfigured PATH

It's a shot in the dark ... but worth a look.

Run this in your terminal and post the results:

echo $PATH

By default, the result should be similar to this: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

If the $PATH is empty, you can edit your ~/.profile to fix it. Reference: http://apple.stackexchange.com/a/11748

Another idea, is you could create a new user and see if any issues are resolved. That's not ideal, but it may shed light on what the problem really is.

john petroshius
john petroshius
Pro Student 146 Points

yes, maybe you are right about PATH...another thing I did was to create a new set of PATH locations...now that I look at the return from echo $PATH, I see that perhaps I messed up...looks like maybe I put semi-colons in some places that should have colons...here's what I got back from my terminal" johnnyP$ echo $PATH /usr/local/bin;/usr/local/sbin;/usr/local/mysql/bin;/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

...if I redo the PATH stuff with colons would that make thing work?

...thanks again for all your help, guys:)

-johnP

Erika Suzuki
Erika Suzuki
19,026 Points

Restart your computer and launch terminal again.