Skip to content

How to set neovim's g:ruby_host_prog to use chruby? #497

Answered by pjg
pjg asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to make this work in command line nvim with the following configuration:

let g:ruby_host_prog = '~/bin/chruby-wrapper'

and chruby-wrapper looking like this:

#!/bin/zsh

if [ -d /usr/local/share/chruby ]; then
  # amd64
  source /usr/local/share/chruby/chruby.sh
  source /usr/local/share/chruby/auto.sh
elif [ -d /opt/homebrew/share/chruby ]; then
  # arm64
  source /opt/homebrew/share/chruby/chruby.sh
  source /opt/homebrew/share/chruby/auto.sh
fi

chruby_auto

# original call
exec "ruby" "$@"

In order to make this work in goneovim/VimR one more trick is required. Those MacOS applications will not read ~/.zshrc while running as this file is only read for interactive shells (ref…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pjg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant