Error: -bash: curl: command not found

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)

Posted on Jul 30, 2007 6:29 PM

Reply
Question marked as ⚠️ Top-ranking reply

Posted on Jul 31, 2007 7:15 AM

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

7 replies
Sort By: 
Question marked as ⚠️ Top-ranking reply

Jul 31, 2007 7:15 AM in response to snowmaninthesun

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

Reply

Jul 31, 2007 3:41 PM in response to Bill Scott

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.
Reply

Jul 31, 2007 6:02 PM in response to snowmaninthesun

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
Reply

Aug 1, 2007 5:38 AM in response to snowmaninthesun

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:

/bin/chmod

Steve
Reply

Aug 1, 2007 12:04 PM in response to Steve Herman1

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?
Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Error: -bash: curl: command not found

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.