kayyao
kayyao

Reputation: 11

Location of ruby file - move away from local directory

I am new to this and trying to learn how to code - so thanks for your patience and help with this very basic question!

I have just installed ruby. When I type which ruby in Terminal, I get the following response:

/usr/local/bin/ruby

Is there a way to move the directory file such that the prompt returns:

/usr/bin/ruby

I have been told that the ruby file should be in the global directory so that it's better and easier to access.

Upvotes: 1

Views: 155

Answers (2)

lkahtz
lkahtz

Reputation: 4796

If you really want to do this, you can use ruby-build

For example:

$ git clone git://github.com/sstephenson/ruby-build.git
$ cd ruby-build
$ ./install.sh

This will install ruby-build into /usr/local. If you do not have write permission to /usr/local, you will need to run sudo ./install.sh instead. You can install to a different prefix by setting the PREFIX environment variable.

Installing Ruby (then)

$ ruby-build 1.9.2-p290 ~/usr/bin/ruby-1.9.2-p290

enjoy!

Upvotes: 1

Collin
Collin

Reputation: 12287

/usr/local/bin/

is a globally accessible directory. The local folder is usually used for binaries that are local to your install. It's a perfectly fine place for ruby.

Upvotes: 1

Related Questions