Best way start fresh install OSX

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

=== ruby installs ===

mbp:~ teedubb$ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.5.0]

mbp:~ teedubb$ which ruby
/Users/teedubb/.rbenv/shims/ruby

mbp:~ teedubb$ ls -lh /usr/local/bin/ruby
lrwxr-xr-x 1 teedubb admin 37B Feb 6 17:05 /usr/local/bin/ruby ->
…/Cellar/ruby193/1.9.3-p448/bin/ruby

mbp:~ teedubb$ ls -lh /usr/bin/ruby
lrwxr-xr-x 1 root wheel 67B Feb 6 21:56 /usr/bin/ruby ->
/System/Library/Frameworks/Ruby.framework/Versions/1.9/usr/bin/ruby

mbp:~ teedubb$ /usr/bin/ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-darwin12.5.0]

On Feb 11, 2014, at 19:42, Tee D. [email protected] wrote:

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

The shebang is wrong. Do:

ruby -S brew update

And it’ll prolly even fix the shebangs.

On Wed, Feb 12, 2014 at 7:43 AM, Tee D. [email protected] wrote:

That didn’t work for me.

What Ryan suggested:

ruby -S brew update

What you say you did:

mbp:~ teedubb$ brew -s brew update

And it “didn’t work”. Huh. Fancy that.

That didn’t work for me.

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

Now I’m getting a different error

mbp:~ brew$ ruby -S brew update
ruby: no Ruby script found in input (LoadError)

ruby: no Ruby script found in input (LoadError)

But ruby works aside from that?

On Thu, Feb 13, 2014 at 3:21 AM, Tee D. [email protected] 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” “[email protected]
else
exec ruby -W0 “$BREW_LIBRARY_DIRECTORY/brew.rb” “[email protected]
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.

| Privacy Policy | Terms of Service | Remote Ruby Jobs