[coc.nvim]Failed to start Solargraph: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your %path%/Gemfile.lock. (Gem::GemNotFoundException)
Yes, this is how the problem looks.
You decided to work in VIM. And ruby is on your list of langauges you are writing in. Most likely
that you will end up using a great tool called
coc.vim - an intellisense engine from VIM and
For coc.vim to be of use to you - it has to rely on an external langauge server.
The installation is straightforward but if you are using
zsh and decide to use
solargraph.useBundler option with you have good chances of seeing the error above.
Well turns out the extension runs commands in a non-interactive login shell.
This means your
.zshrc file is not loaded and whatever you’ve put there too. For example you
rbenv that requires to be sourced in
.zshrc by default.
As the result -
rbenv is never loaded and
coc-solargraph can’t find
bundler because it looks
for it you system’s default ruby path instead of using the one provided by
.zshrc is not used at this time you will have to put your
rbenv string somewhere else.
And this ‘somewhere’ is your
rbenv-doctor to check if your
rbenv installation is ok. You will also be prompted your
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
Result will look something like this:
Checking for `rbenv' in PATH: /home/user/.rbenv/bin ... ... ...
Just add those lines2 to this file (create one if it does not exist):
export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"