sstephenson/rbenv — Issue #187: Fall back to other binary in PATH if gem-installed binary not installed in current ruby
Author: gerrit
Created: 2012-02-02 22:32:10+00:00
State: open

I‘ve got a binary (installed by npm) in `/usr/local/bin/lessc` that I would like to use some of the time. But for some Ruby projects I‘m using the LESS gem which installs a binary in `~/.rbenv/shims/lessc`.

`~/.rbenv/shims` is before `/usr/local/bin` in my `PATH`.

I’d like to be able to use the gem-provided binary when I‘m using a ruby version where it is installed, and otherwise (default case for me) fall back to `/usr/local/bin/lessc`.

Currently, I get the message

`rbenv: lessc: command not found

The `lessc' command exists in these Ruby versions:
1.9.2-p290`

and the only way to use the npm-provided binary by specifying the whole path. It seems to me that the shim binary should fall back to other binaries that are in the `PATH` already if nothing is installed in the current ruby.