wdspkr
wdspkr

Reputation: 636

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?

Upvotes: 1

Views: 2341

Answers (2)

Dustin
Dustin

Reputation: 376

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.

Upvotes: 0

Steve Ross
Steve Ross

Reputation: 1218

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

Upvotes: 1

Related Questions