Installing Ruby 1.9.3 OSX 10.7.4 breaks after altering PATH

Posted by R V on Super User See other posts from Super User or by R V
Published on 2012-10-11T07:45:19Z Indexed on 2012/10/12 21:39 UTC
Read the original article Hit count: 333

Filed under:
|
|
|

I was having trouble installing ruby 1.9.3-p194 from ruby 1.8.7 on my mac osx 10.7.4.

I have was trying to fix my homebrew after running "brew doctor" and got the message of "/usr/bin occurs before /usr/local/bin This means that system-provided programs will be used instead of those provided by Homebrew. The following tools exist at both paths: c++-4.2 cpp-4.2 erb g++-4.2 gcc-4.2 gcov-4.2 gem i686-apple-darwin11-cpp-4.2.1 i686-apple-darwin11-g++-4.2.1 i686-apple-darwin11-gcc-4.2.1 irb rake rdoc ri ruby testrb"

I fixed it by entering the following, which I found on another stackoverflow answer:

export PATH="/usr/local/bin:/usr/local/sbin:~/bin$PATH"

Lo and behold! when I typed that ruby updates to 1.9.3-p194. Ruby files seem to compile and run just fine.

However, afterward, my navigation around terminal is messed up severely. For instance I can't do the command "open example_file.html" and have the file pop up in Chrome, instead I get the error: "-bash: open: command not found"

Also, when I change directory, I get an error, inputting "$ cd desktop" yields the output, "-bash: dirname: command not found"

but the directory does then changes... strange.

When I exit out of a terminal window all this resets. I'm back to Ruby 1.8.7, have to use the PATH command again to update to 1.9.3, command line navigation gets broken again.

Any guidance on how to remedy so I can use 1.9.3-p194 and also have normal terminal navigation would be greatly appreciated.

© Super User or respective owner

Related posts about ruby

Related posts about osx