7 Replies Latest reply: Aug 1, 2007 3:27 PM by snowmaninthesun
snowmaninthesun Level 1 (0 points)
I have successfully installed full ruby (1.8.4) using terminal commands, but for unknown reasons I can no longer access the commands curl, sudo, and many others. Although i had access to these commands a few minutes ago, i can't get any of them to work. I would prefer to figure out what i did to make these commands not available and fix that, but i would also appreciate directions to install the individual opensource files such as "curl-28.0.3" from http://www.opensource.apple.com/darwinsource/10.4.9.x86/. I am a new terminal user, so any and all help is truly appreciated.

Mac Book Pro Intel, Mac OS X (10.4.10)
  • Bill Scott Level 6 (11,445 points)
    Somehow, you clobbered the PATH.

    You probably have something like this in whatever startup file you modified:

    export PATH=/path/to/your/new/ruby/bin

    whereas it should be something like

    export PATH=$PATH:/path/to/your/new/ruby/bin

  • snowmaninthesun Level 1 (0 points)
    Thanks, It looks like i did screw up the path right after i finished my install

    What i typed was:

    echo 'export PATH="/usr/local/ruby/bin:usr/local/sbin: $PATH"' >> ~/.profile

    What i was supposed to type was:

    echo 'export PATH="/usr/local/bin:usr/local/sbin:$PATH"' >> ~/.profile

    i guess this is what i get for attempting to follow directions without knowing exactly what i'm doing.

    What do i need to do to correct my path?

    Sorry for you to have to spell it out, but i don't want to unwittingly do any more damage.
  • Ken Nellis Level 2 (245 points)
    Each time you enter

    echo 'whatever' >> ~/.profile

    you add a new line to the end of file ~/.profile. To recover, edit that file and remove the bad entries. Then do the right thing. One way to edit the file is simply to open it with TextEdit from the Terminal command line:

    open ~/.profile
  • snowmaninthesun Level 1 (0 points)
    -bash: open: command not found

    can't open ~/.profile from terminal...any other ideas for editing?

    I have tried repeating the correct line:

    echo 'export PATH="/usr/local/bin:/usr/local/sbin:$PATH"' >> ~/.profile

    but this doesn't solve anything...
  • Steve Herman1 Level 4 (2,545 points)
    Since your PATH variable is screwed up you'll have to use the full path to any command you want to run until you get the PATH fixed. Try this to open your .profile file:

    /usr/bin/open ~/.profile

    Also, in the meantime if you need to find the full path to any other commands you can use "which"... but you'll have to use the full path to it too...

    /usr/bin/which SomeCommand

    For example:

    /usr/bin/which chmod

    should give you:


  • snowmaninthesun Level 1 (0 points)
    That worked, that you so much!! Apparently I typed the wrong thing more than a few times, which is probably the cause of my problems this is what was in my /.profile:

    export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
    export PATH="/usr/local/bin:/usr/local/sbin:$path"
    export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
    export PATH="/usr/local/ruby/bin:/usr/local/sbin:$PATH"
    export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
    # Your previous .profile (if any) is saved as .profile.mpsaved
    # Setting the path for MacPorts.
    export PATH=/opt/local/bin:/opt/local/sbin:$PATH
    export PATH="/usr/local/bin:usr/local/sbin:$PATH"
    export PATH="/usr/local/ruby/bin:usr/local/sbin:$PATH"
    export PATH="/usr/local/bin:usr/local/sbin:$PATH"
    export PATH="/usr/local/bun:/usr/local/sbin:$PATH"
    export PATH="/usr/local/bin:/usr/local/sbin:$PATH"

    I'm assuming that i need to delete all lines except for:

    export PATH="/usr/local/bin:/usr/local/sbin:$PATH"

    and then save the file, right?
  • snowmaninthesun Level 1 (0 points)
    Changed profile to:

    export PATH="/usr/bin/:$PATH"

    worked like a charm...thanks for the help everyone