2

I have installed homebrew on my Mac, but no matter what brew command I run, I get:

/usr/local/bin/brew:6:in `require': no such file to load -- pathname (LoadError)
from /usr/local/bin/brew:6

I am using zsh and I believe I have the right $PATH (but I could be wrong...)

Any ideas where I should look to fix this?


Update: My issue doesn't really have much to do with homebrew as it seems to be related to a broken installation of Ruby.

I still need to fix my Ruby install nonetheless.

fighella
  • 121

1 Answers1

1

It looks like you have replaced the default Ruby version with a version of Ruby that doesn't include pathname. on its module search path. Fix your Ruby installation, or point /usr/bin/ruby to the default installation. For me it's the following:

lrwxr-xr-x 1 root wheel 76 30 Jun 2010 /usr/bin/ruby -> ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby


To be sure, run the following command and check these directories for a file called pathname.rb:

$ /usr/bin/ruby -e "puts $:"
/Library/Ruby/Site/1.8
/Library/Ruby/Site/1.8/powerpc-darwin10.0
/Library/Ruby/Site/1.8/universal-darwin10.0
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8/universal-darwin10.0
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/powerpc-darwin10.0
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0
.

I found pathname.rb in the second group of directories:

find /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby -iname "pathname.rb"
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb    
Daniel Beck
  • 111,893