可执行文件指向rbenv而不是homebrew

时间:2014-06-23 06:06:34

标签: rbenv

已安装gem 'image_optim_bin',但无效。

$ jpegoptim
/Users/aj/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/image_optim_bin-0.0.4/bin/jpegoptim:1:in `<top (required)>': uninitialized constant ELF (NameError)
    from /Users/aj/.rbenv/versions/2.1.0/bin/jpegoptim:23:in `load'
    from /Users/aj/.rbenv/versions/2.1.0/bin/jpegoptim:23:in `<main>'

如此卸载,并与自制软件一起安装。

$ gem uninstall image_optim_bin
Remove executables? [Yn]  Y

$ brew install jpegoptim

$ brew unlink jpegoptim && brew link jpegoptim
Unlinking /usr/local/Cellar/jpegoptim/1.4.0... 2 symlinks removed
Linking /usr/local/Cellar/jpegoptim/1.4.0... 2 symlinks created

$ which jpegoptim
/Users/aj/.rbenv/shims/jpegoptim

$ gem list | egrep 'jpe?g|optim'

为什么它仍然指向rbenv路径?

1 个答案:

答案 0 :(得分:0)

在2个月内离开这里。要重拍!

$ rbenv rehash
$ jpegoptim
jpegoptim: file arguments missing
Try 'jpegoptim --help' for more information.