Skip to Content

![Sand]whiches

Posted on One min read

which is a useful tool to find the path of an executable, eg:

$ which ruby
/Users/ztaylo43/.rubies/ruby-2.4.4/bin/ruby

which also has an -a flag which shows all executables, eg:

$ which -a ruby
/Users/ztaylo43/.rubies/ruby-2.4.4/bin/ruby
/usr/bin/ruby

And ruby provides the same for gems, eg:

$ gem which rspec
/Users/ztaylo43/.gem/ruby/2.4.4/gems/rspec-3.8.0/lib/rspec.rb

This can be super helpful for those times when you’re debugging, and desperation leads you to follow the stacktrace into gemland.