Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

anttyaadiggg

macrumors newbie
Original poster
Aug 28, 2013
5
0
hi everyone,

so recently i was doing lynda's ruby on rails tutorial and i was following the viedo when it was talking about unix and i sort of messed up while in terminal, and im not too sure how to fix this issue so i was thinking maybe someone more experience with terminal and macbook pros would be able to help me. i called apple and they were kinda clueless.. but here is what terminal says everytime i open it. i recently installed homebrew too so maybe that is another one of the issues


Code:
Last login: Thu Aug 29 00:27:14 on ttys000
-bash: export: `/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin': not a valid identifier
Anthonys-MacBook-Pro:~ Anthony$

everytime i try and go back into the nano command " nano .bash_profile" it says
Code:
-bash: nano: No such file or directory

and even when i type other commands like ll or ls -la it says the same thing. i just wanna make it normal again

any help?? Thank you for your time
 
Start terminal, and type the following, then press Enter:

Code:
echo $PATH

If is is anything different than the following, put in the next command to fix it.

Code:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH

I think what you were trying for was to add the "/usr/local/mysql/bin" bit for the installation of MySQL, and to do that just use this:

Code:
echo "export PATH=$PATH:/usr/local/mysql/bin" >> ~/.profile && . ~/.profile
 
sorry for the late response but
when i entered the echo $PATH this is what happen


Code:
Anthonys-MacBook-Pro:~ Anthony$ echo $PATH

Anthonys-MacBook-Pro:~ Anthony$

when i add the export PATH=/opt/local/bin:/opt/local/sbin:$PATH part you said this is what happens

Code:
Anthonys-MacBook-Pro:~ Anthony$ export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Anthonys-MacBook-Pro:~ Anthony$

its like nothing at all is working i cant even use the nano command to go back into the .bash_profile where i originally where i messed up
 
sorry for the late response but
when i entered the echo $PATH this is what happen


Code:
Anthonys-MacBook-Pro:~ Anthony$ echo $PATH

Anthonys-MacBook-Pro:~ Anthony$

when i add the export PATH=/opt/local/bin:/opt/local/sbin:$PATH part you said this is what happens

Code:
Anthonys-MacBook-Pro:~ Anthony$ export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Anthonys-MacBook-Pro:~ Anthony$

its like nothing at all is working i cant even use the nano command to go back into the .bash_profile where i originally where i messed up

Open Terminal and type:

Code:
cat /etc/paths

What does it output?
It should say:

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
If it doesn't say that, then type the following to edit it so that it does:
Code:
sudo nano /etc/paths

Then, type:

Code:
rm -f .bash_profile .profile

This will effectively reset the PATH variable.
 
i tried the cat /etc/paths and heres the results

Code:
Anthonys-MacBook-Pro:~ Anthony$ cat /etc/paths
-bash: cat: No such file or directory

even tried the sudo nano /etc/paths

Code:
Anthonys-MacBook-Pro:~ Anthony$ sudo nano /etc/paths
-bash: sudo: No such file or directory

the no such file or directory thing is constant, its pretty much the result i always get even when i try to do other things to see if it fixes it.

something else to add when i put /bin/bash heres the result
Code:
Anthonys-MacBook-Pro:~ Anthony$ /bin/bash
bash-3.2$

but even when i do that and try everything you said its still the same results
 
Last edited:
instead of cat /etc/paths, try:

Code:
/bin/cat /etc/paths

If you see the output:

Code:
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

Then you can quickly restore a basic path environment with the command:

Code:
eval `/usr/libexec/path_helper -s`
(notice the backticks)
 
Last edited:
when i put in the /bin/cat /etc/paths heres the output

Code:
Anthonys-MacBook-Pro:~ Anthony$ /bin/cat /etc/paths
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

then when i put in the next command heres what happens

Code:
Anthonys-MacBook-Pro:~ Anthony$ eval `/usr/libexec/path_helper -s`
Anthonys-MacBook-Pro:~ Anthony$

nothing changed because when i closed terminal and opened a new terminal window it still has this at the top


Code:
-bash: export: `/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin': not a valid identifier
Anthonys-MacBook-Pro:~ Anthony$
 
quick update

i entered

Code:
/bin/mv .bash_profile bash_profile_disabled

into the terminal and opened a new terminal window and the invalid identifer message is now gone but now my bash_profile is disabled so i guess what im gonna do is fix the error and then try and re enable it and see if that fixes everything
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.