when i type
$ gem
in my terminal (mac osx) it says
-bash: /usr/bin/ge开发者_运维问答m: No such file or directory
yes, i know theres no such file or directory, its in
/opt/local/lib/ruby/gems/1.8
why is it looking there?
$ echo $PATH
/opt/local/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/Users/mike/.local/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin
euclid:~ seth$ ls -l /usr/bin/gem
lrwxr-xr-x 1 root wheel 71 May 4 2010 /usr/bin/gem -> ../../System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
Just a guess, but if you used something like MacPorts to install a new version of Ruby, it probably broke the gem
symlink in /usr/bin
.
You can probably "fix" it by just making a working symlink:
$ cd /opt/local/bin
$ ln -s /opt/local/lib/ruby/gems/1.8/usr/bin/gem .
edit your .profile and add :/opt/local/lib/ruby/gems/1.8 to the end of the path variable. But I would think this error means you didn't setup or install something correctly.
精彩评论