Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from stackoverflow.com Jun 1 '11 at 13:31

This question came from our site for professional and enthusiast programmers.

1  
Where is your ruby installation? Which version do you use? pathname is a core library in Ruby so if that doesn't work, your Ruby installation seems broken. – slhck Jun 1 '11 at 13:41
    
so if my ruby install was "broken" how would i best fix it? I have followed these instructions hivelogic.com/articles/… (a few times) but it doesnt solve my problem... – fighella Jun 1 '11 at 14:09
    
My quick fix would probably be to install a newer Ruby (e.g. 1.9.2) with rvm instead of doing it manually. I use that setup with Homebrew and it works quite well. – slhck Jun 1 '11 at 14:21
    
and that's exactly what I've done thats got me here. "/usr/local/bin/brew:6:in `require': no such file to load -- pathname (LoadError) from /usr/local/bin/brew:6" – fighella Jun 1 '11 at 14:42
1  
No, I was guessing you installed a system-wide Ruby manually before, not with rvm. – slhck Jun 1 '11 at 14:43

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    
share|improve this answer
    
➜ ~ /usr/bin/ruby -e "puts $:" /opt/local/lib/ruby/site_ruby/1.8 /opt/local/lib/ruby/site_ruby/1.8/i686-darwin10 /opt/local/lib/ruby/site_ruby /opt/local/lib/ruby/vendor_ruby/1.8 /opt/local/lib/ruby/vendor_ruby/1.8/i686-darwin10 /opt/local/lib/ruby/vendor_ruby /opt/local/lib/ruby/1.8 /opt/local/lib/ruby/1.8/i686-darwin10 – fighella Jun 1 '11 at 14:11
    
it looks like its that refers to macports? is that right... i am trying to NOT use macports any more... – fighella Jun 1 '11 at 14:13
1  
use ln -s to replace your /usr/bin/ruby link to the default installation. thats why i included the path in my post. – Daniel Beck Jun 1 '11 at 14:22
    
so lets say my "default installation" is fubarred, how would i fix that? – fighella Jun 2 '11 at 5:55
    
@fighella Reinstalling (you can keep user accounts and application, IIRC) or using Pacifist. – Daniel Beck Jun 2 '11 at 7:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .