Wednesday, August 5, 2009

Paths

While working on web development, which is where this project has taken me, I stumbled across Ruby on Rails, as talked about earlier. One of the most frustrating things so far was while working on rails projects, my path did not include the folder with the ruby binaries. I first tried to do an export command like this

$export PATH=/var/ruby/1.8/gem_home/bin

This worked, except it meant my path ONLY went to that folder. Here is the correct command to add the folder to your path, not make it your only folder.

$export PATH=$(echo $PATH):/var/ruby/1.8/gem_home/bin

This says, i'm exporting a new variable called path. The $( before echo means I'm about to run a command, which in this case just echos the variable $PATH. Then I added what I wanted to add. A quick $echo $PATH will show if you were successful or not.


No comments:

Post a Comment