When trying to install pg gem: Brew bad interpreter error and not existing ruby version
-
21-07-2021 - |
Question
I've really made something wrong when re-installing ruby, rails, xcode etc. (maybe even I've deleted my system Ruby installation :/ ) Here's what I have now:
System: OSX 10.8.2 (64-bit)
which ruby
gives me /usr/local/bin/ruby
I have installed ruby 1.9.3p286
, Rails 3.2.8
and rvm 1.16.17 (stable)
I've installed Ruby and Rails by going with this tips: http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard
Next I wanted to run gem install pg
but I've got an error: No such file or directory - brew --prefix
I've tried hit just the brew
command but I've got another error: /usr/local/bin/brew: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin: no such file or directory
So there is my question (I have installed brew earlier) - why it points on this path of 1.8 Ruby if I don't have this version of Ruby installed? Can I somehow change this path to my current one with ruby(that from which ruby command?)? How fix this brew error? Please help!
Solution
Okay, I got it - I've edited the file: /usr/local/bin/brew
and edited ther (first line) the path: from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
to /usr/local/bin/ruby/
and it works now..
Anyone knows how to change default system Ruby path to this one? (to avoid problems with other programs in the future).
OTHER TIPS
That didn't work for me but it set me on the right track..... I had to do this:
sudo ln -s /usr/local/bin/ruby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
(and make the bin directory before hand)