Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
616 views
in Technique[技术] by (71.8m points)

bash - Installing Ruby with Homebrew

I installed Ruby with Homebrew:

brew install ruby

Under "Caveats" it said:

NOTE: By default, gem installed binaries will be placed into:
/usr/local/Cellar/ruby/1.9.3-p194/bin

You may want to add this to your PATH.

What does that mean and how can I add it to my "path"? Assuming it has to do with a bash_profile but new to this.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

in ~/.bash_profile add the following line

export PATH=/usr/local/Cellar/ruby/1.9.3-p194/bin:$PATH

When you're done, close your terminal and re-open it. You should be fine.

Alternatively, you can execute the follwing in each open shell instead of closing/re-opening:

source ~/.bash_profile

Note: I highly recommend installing ruby via rvm or rbenv so you can manage multiple ruby versions and use gemsets.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...