1
0
Fork 0

If a default ruby is set for the user, switch to it

If a default ruby is set for the user, switch to it automatically. This
sets the PATH variables and allows gems such as `bundler` to be found,
allowing the `bundler` aliases to be enabled.
This only matters when a default ruby is _not_ the system ruby, and/or
when bundler is not installed for the system ruby but is installed for
the default ruby.

This also fixes an issue where the `ruby-info` function has the wrong
info for the initial prompt.

A `.ruby-version` file must exist in the users $HOME directory (as
recommended here for auto-switching:
https://github.com/postmodern/chruby#default-ruby)
pull/619/head
Shane O'Grady 11 years ago
parent bf9dbfd5b9
commit 1d4d36024f

@ -28,6 +28,8 @@ elif (( $+commands[chruby-exec] )); then
source "${commands[chruby-exec]:h:h}/share/chruby/chruby.sh" source "${commands[chruby-exec]:h:h}/share/chruby/chruby.sh"
if zstyle -t ':prezto:module:ruby:chruby' auto-switch; then if zstyle -t ':prezto:module:ruby:chruby' auto-switch; then
source "${commands[chruby-exec]:h:h}/share/chruby/auto.sh" source "${commands[chruby-exec]:h:h}/share/chruby/auto.sh"
# If a default ruby is configured for the user, switch to it
chruby_auto
fi fi
# Prepend local gems bin directories to PATH. # Prepend local gems bin directories to PATH.

Loading…
Cancel
Save