Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add usr/local/bin to path environment variable on ubuntu 12.0.4?

Tags:

path

ruby

ubuntu

I have just installed ruby.1.8.6 on Ubuntu 12.0.4.

I am learning ruby out of a book and after the installation process it says

"Once it's completed, you should add /usr/local/bin to your PATH environment variable. I'll assume that, being a Linux user"

And I'm stuck as the guy has a wrong assumption.

How do I add usr/local/bin to the path environment variable?

like image 967
Omer Raja Avatar asked Feb 24 '13 09:02

Omer Raja


People also ask

How do I add the bin directory to the PATH environment variable in Ubuntu?

Open the . bash_profile file in your home directory (for example, /Users/your-user-name/. bash_profile ) in a text editor. Add export PATH="your-dir:$PATH" to the last line of the file, where your-dir is the directory you want to add.

How do I add a directory to the PATH system environment variable?

To add a path to the PATH environment variableIn the System dialog box, click Advanced system settings. On the Advanced tab of the System Properties dialog box, click Environment Variables. In the System Variables box of the Environment Variables dialog box, scroll to Path and select it.


1 Answers

You can add this to your ~/.bashrc file:

PATH=$PATH:/usr/local/bin

If you don't know how, you can just execute this line in a Terminal:

echo "PATH=\$PATH:/usr/local/bin" >> ~/.bashrc

You can also check what's in your PATH by typing in the Terminal

echo $PATH
like image 105
alestanis Avatar answered Oct 10 '22 19:10

alestanis