When trying to install pg gem: Brew a bad interpreter error and a non-existent ruby ​​version

I really did something wrong when reinstalling rubies, rails, xcode, etc. (maybe even I uninstalled my Ruby installation system: /) Here is what I have now:

System: OSX 10.8.2 (64-bit)

which ruby gives me /usr/local/bin/ruby

I installed ruby 1.9.3p286 , Rails 3.2.8 and rvm 1.16.17 (stable)

I installed Ruby and Rails by following these tips: http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard

Next, I wanted to run gem install pg , but I have an error: No such file or directory - brew --prefix

I have only tried the brew command, but I have 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 installed brew before) - why does it point to this 1.8 Ruby path if I don't have this version of Ruby installed? Can I somehow change this path to my current one with ruby ​​(which one from the ruby ​​team?)? How to fix this brew error? Please, help!

+4
source share
2 answers

Ok, I get it - I edited the file: /usr/local/bin/brew and edited ther (first line) path: from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin to /usr/local/bin/ruby/ and now it works.

Does anyone know how to change the standard Ruby path to this? (to avoid problems with other programs in the future).

+4
source

This did not work for me, but it set me on the right path ..... 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)

+2
source

Source: https://habr.com/ru/post/1443051/


All Articles