Ruby: aliased to bundled_ruby

When I type which ruby , it always returns ruby: aliased to bundled_ruby

When I try which bundled_ruby , it returns:

 bundled_ruby () { _run-with-bundler ruby $@ } 

Then I will try which _run-with-bundler , and it returns:

 _run-with-bundler () { if _bundler-installed && _within-bundled-project then bundle exec $@ else $@ fi } 

Where did all this come from and how did I earn which ruby again?

I am using OSX (v10.8.2), brew, rbenv, ruby-build, zsh

+7
ruby rbenv
source share
2 answers

This is part of rbenv "magic" to handle multiple ruby ​​versions with multiple versions of gem. Take a look at ~/.rbenv/shims/ruby , IIRC a script is defined there.

If you want to disable this, just unalias ruby : this will delete the generated alias.

+4
source share

It can be created from the bundler the oh-my-zsh plugin .

He uses magic to avoid entering bundle exec before the following commands: annotate berks cap capify cucumber foodcritic foreman guard jekyll kitchen knife middleman nanoc rackup rainbows rake rspec ruby shotgun spec spin spork strainer tailor taps thin thor unicorn unicorn_rails puma

You can disable this magic for some commands by setting the UNBUNDLED_COMMANDS environment UNBUNDLED_COMMANDS to ~ ~ .zshrc before loading the oh-my-zsh plugins (see oh-my-zsh pull request # 2195 ).

 export UNBUNDLED_COMMANDS=ruby # for a list of commands export UNBUNDLED_COMMANDS=(ruby irb rake) 

Or you can simply remove the bundler plugin from oh-my-zsh plugins.

+14
source share

All Articles