On Thu, Feb 13, 2014 at 3:21 AM, Tee Dubb <lists / ruby-forum.com> wrote:

> Now I'm getting a different error
>
> mbp:~ brew$ ruby -S brew update
> ruby: no Ruby script found in input (LoadError)
>
>
It's a good idea, but unfortunately not going to work, homebrew is
bootstrapped with a shellscript, not Ruby:



> cat "$(which brew)" && echo ---------
#!/bin/sh
BREW_FILE_DIRECTORY=$(dirname "$0")
BREW_FILE_DIRECTORY=$(cd "$BREW_FILE_DIRECTORY" && pwd -P)

BREW_FILENAME=$(basename "$0")
export HOMEBREW_BREW_FILE="$BREW_FILE_DIRECTORY/$BREW_FILENAME"

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_LIBRARY_DIRECTORY=$(cd "$BREW_FILE_DIRECTORY"/../Library && pwd -P)

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