I wanted to start developing in ruby on rails, so I followed few tutorials how to set everything needed. However, I have problem now, because basic commands in terminal window dont work. For example if I type: whoami, ls, etc... error appears saying: -bash: whomami: command not found
when I type: $PATH, this appears: -bash: /Library/Ruby/Gems/2.0.0: is a directory
did I make a mistake while setting up rails environment or it's another problem? If you have similar experiences, please help me to solve this.
Thanks
Try the following command.
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Better you use this command in you .bashrc file.
Related
I am an absolute beginner using (actually trying to) Mac High Sierra with Sublime3 and Python2.7. Just installed them.
When I test Sublime on terminal, here's what I get:
pc37:desktop flop$ one
-bash: one: command not found
I setup Sublime to write in Python and saved the file "one.py" on my desktop.
Does it come from Sublime or the OS?
I read a few debugging articles on the subject but didn't understand half of it... Didn't want to make the situation worst using wrong command lines.
Could someone help please? Thank you! Flo
You need to use valid Bash command syntax for executing Python scripts in Terminal:
python one.py
...or...
./one.py
Of course this requires you cd to ~/Desktop first.
This question already has an answer here:
How to restore .bash_profile on a mac? None of my unix terminal are working [closed]
(1 answer)
Closed 2 years ago.
I messed up something in my programming a few days ago that screwed up my terminal. My terminal now gives me the a bash error message with basic functions like ls, cd, or ssh. The error looks like this: -bash: ls: command not found , where the "ls" can be replaced with any shell command.
The only way I have found to make my terminal function, is by inputting: export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin" into ever terminal window I open, which can get very tedious.
It also refuses to run Python or Jupyter unless I type the aforementioned command in the terminal window first.
Go files also fail to run in terminal, and gives me a similar error message: -bash: go: command not found. This can be overcome by inputting: export PATH=$PATH:/usr/local/go/bin into the terminal window first.
I'm really worried about what is going on in my computer, and need my terminal to keep functioning in order for me to finish and pass this course (introduction to computer programming). Does anyone have any ideas as to what the problem may be, and how I could go about solving it?
Any help/advice would be greatly appreciated!!!
EDIT: I'm not sure if it is relevant, but I am using a Mac, and these problems started to occur after I attempted to download pygame (I say "attempted" because I never got a working version of pygame installed, though I did download several things in the process (XQuartz and a bunch of stuff from homebrew).
Check your .profile or .bashrc: one of those files might initialize your PATH incorrectly.
Set your PATH manually, then cd ~, and edit those two files to fix your PATH.
I'm new in programming and I'm running into a problem. When I want to compile the program (cop) everything is ok but when I want to execute the program I have this: " :-bash:prgmname: command not found "
I don't understand why, it never happened before. I don't know if it'll help but I'm using Sublime Text. I tried to look at similar questions but I don't understand the answers... Sorry if my question sounds stupid but please answer if you have any idea why it does this and how to solve it.
By doing
cop
the command line interpreter will look for the standard bin directories, say /bin for the command. What you should do is
./cop
This searches the file in the current directory
I am a beginner coder, so bear with me. I was doing the lynda.com tutorials on Ruby on Rails and in the Terminal typed in nano .bash_profile and then export PATH="usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH". Now everytime I log in I get the message :
-bash: export: `/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier
and I even when I tried to find it using which $SHELL it says that No such file or directory. What can I do to fix this?
PATH="usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
should be
PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
I've installed mysql on my laptop.
Now when I launch a terminal window and a unix command like grep, I get this message:
-bash: grep: command not found
-bash: cat: command not found
...
What's happen ? Do you have skills or any ideas to retrieve my precious unix functions ?
I'd like to put this in a comment, but I don't have enough reputation, sorry!
Basic Unix commands like grep or cat are most likely in this folder:
/usr/bin
In order for them to work, you need to have the correct set up of your PATH variable. You might have changed it unknowingly during the installation of mysql.
You can fix this temporarily by trying something like:
export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
This will add whatever you have on your PATH at the moment, all the "normal" routes to your precious unix functions. Try the commands again after executing this line in your terminal, and let us know :)