Help, Terminal messed up

Discussion in 'Mac Programming' started by gussic, Jul 8, 2014.

  1. gussic macrumors newbie

    Joined:
    Jan 31, 2009
    #1
    Hi All, Having major issues with terminal after trying to get the command 'subl' to open Sublime can someone help please?

    Did some reading in other thread about commands to run but i can't figure out what is wrong or how to fix it, see below

    Last login: Tue Jul 8 23:11:15 on ttys000
    -bash: uname: command not found
    -bash: ps: command not found
    Angus-MBP:~ Angus$ sudo
    -bash: sudo: command not found
    Angus-MBP:~ Angus$ mkdir
    -bash: mkdir: command not found
    Angus-MBP:~ Angus$ /bin/cat ~/.bash_profile
    export PATH=/usr/local/bin:

    [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
    Angus-MBP:~ Angus$ mkdir
    -bash: mkdir: command not found
    Angus-MBP:~ Angus$ export PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
    Angus-MBP:~ Angus$ subl
    -bash: subl: command not found
    Angus-MBP:~ Angus$ echo $SHELL; echo $PATH; which dirname basename
    /bin/bash
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
    /usr/bin/dirname
    /usr/bin/basename
    Angus-MBP:~ Angus$ cat ~/.profile

    export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
    Angus-MBP:~ Angus$ /bin/cat ~/.profile

    export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
    Angus-MBP:~ Angus$ /bin/cat ~/.bashrc

    export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
    Angus-MBP:~ Angus$ /bin/cat ~/.login
    cat: /Users/Angus/.login: No such file or directory
    Angus-MBP:~ Angus$ /bin/cat ~/.bash_profile
    export PATH=/usr/local/bin:

    [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
    Angus-MBP:~ Angus$
     
  2. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    I'm going to say you have a messed up .bashrc or .bash_profile file. Reveal hidden items in Finder (IE, by using Tinker Tool) and then look for a file named one of those underneath your home directory.
     
  3. gussic thread starter macrumors newbie

    Joined:
    Jan 31, 2009
  4. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #4
    1. Launch Terminal.app. Then copy and paste the following into a Terminal window:
    Code:
    /bin/mkdir ~/bad
    /bin/mv ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc ~/bad
    
    There may be an error message.
    Post the complete output within CODE tags.

    2. Quit Terminal.app, then relaunch it. Copy and paste the following into a Terminal window:
    Code:
    /bin/ls -la ~ ~/bad ; echo ; echo "$PATH"
    
    Post the output here, including all output, error messages, etc.
    Put the output within CODE tags.

    3. Explain where you read or obtained the commands, instructions, etc. that lead to the problem.


    The above does two things: it moves the problematic shell-profile files into a newly created directory named 'bad', it then lists the complete contents of your home directory and the 'bad' directory, and also shows the value of PATH.

    After doing the above, and having a chance to read your output, I will suggest other commands. But I really need to see the output and the results before proceeding. I also need to know exactly what rvm and subl are supposed to do, and for that I need to know the original instructions you followed that led to the conditions you're in.
     
  5. D.T. macrumors 604

    D.T.

    Joined:
    Sep 15, 2011
    Location:
    Vilano Beach, FL
    #5
    Great answer, and it makes me chuckle that you're providing terminal help given your username :D

    RVM is Ruby Version Manager, it basically lets you setup a specific Ruby environment per project, and when you cd into the directory, it runs some path configurations and ENV setup (so you can run several different setups across projects). subl is the Sublime Text command line option. It sounds like they were trying to setup their machine to do some Ruby coding, likely setting up Rails.
     

Share This Page