I’ve installed multiple versions in multiple places trying to get
everything up and working, what’s the best way to start fresh? Below
are some of the errors with brew and the different ways I’ve tried to
install Ruby and getting it working properly.
=== brew errors ===
mbp:~ teedubb$ brew update
/usr/local/bin/brew: /usr/local/Library/brew.rb:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad
interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined
error: 0
mbp:~ teedubb$ brew update
/usr/local/bin/brew: /usr/local/Library/brew.rb:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad
interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined
error: 0
mbp:~ teedubb$ brew -s brew update
/usr/local/bin/brew: /usr/local/Library/brew.rb:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby: bad
interpreter: No such file or directory
/usr/local/bin/brew: line 21: /usr/local/Library/brew.rb: Undefined
error: 0
BREW_SYMLINK=$(readlink $0)
if [ -n “$BREW_SYMLINK” ]
then
BREW_SYMLINK_DIRECTORY=$(dirname “$BREW_SYMLINK”)
BREW_FILE_DIRECTORY=$(cd “$BREW_FILE_DIRECTORY” &&
cd “$BREW_SYMLINK_DIRECTORY” && pwd -P)
fi
BREW_SYSTEM=$(uname -s | tr “[:upper:]” “[:lower:]”)
if [ “$BREW_SYSTEM” = “darwin” ]
then
exec “$BREW_LIBRARY_DIRECTORY/brew.rb” “$@”
else
exec ruby -W0 “$BREW_LIBRARY_DIRECTORY/brew.rb” “$@”
fi
Notice the exec at the bottom. Lets check that out:
head -1 “$(which brew)/…/…/Library/brew.rb”
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
-W0
So it’s shebang is hard-coded path to a Ruby it expects to be there. The
question is why yours isn’t there (IDK the answer) and how to get it
back.
IDK if there’s a way to get files back like that, but I’d probably try
either building Ruby 1.8 at that dir, or installing Ruby 1.8 and making
a
symlink or shell script or something. Brew may not be the only program
to
use this Ruby, you could have other things break b/c that Ruby isn’t
there.
-Josh
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.