简体   繁体   中英

How to get a clean homebrew ruby install?

After a time machine migration, some ruby related programs (heroku gem, rails) didn't work anymore. After not getting it fixed with different approaches, I figured that a fresh ruby/rubygems install should do the trick...

Unfortunately I'm not able to get a clean ruby install with homebrew! When I remove ruby and install it again, I get all previously installed gems back. And also rails still does not work. I also tried "brew install --fresh" and deleting the gem folder before removal with brew, the same result!

I have no clue where the gems come from! How do I get homebrew to install a completely fresh ruby version with fresh rubygems?

you need to pay attention to the installer where it says you need to add the gem folder to your path. Also add the version of ruby to your path.

Should look something like this in your ~/.bash_profile

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

I'm not quite sure if this is the source of your problem (and you probably don't have it anymore because this post is old) but for anyone stumbling across this post like I did:

The problem might be that even though you're using brew install --fresh ruby , it's not selecting that version of Ruby when you run commands via the shell. It might still be using the system default. There's an answer here on how to switch to a version of Ruby that was installed using Homebrew, but I definitely recommend RVM. If you're on OSX, you can use a decent GUI called JewelryBox to make the process smoother.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM