Closed ImNotaGit closed 1 year ago
The message "nvimcom version mismatch" means that nvimcom's version in the Nvim-R directory (0.9-147) is different from the nvimcom version already installed. It seems that you have installed a previous version of nvimcom as a different user ("nobody"). Now, you don't have permission to update it in the same directory.
The versions must match because some function calls, the format of the output, or something else changes from one version to another. If the versions are different, either Nvim-R will call a nvimcom function wrongly or nvimcom will output something that Nvim-R can't interpret.
Could you update Nvim-R, please? The script R/before_ncs.R
now checks if nvimcom was installed by the current user. This might help users to debug similar issues.
Hi Jakson, wow, thanks for the super fast response.
It turned out that I have an old Nvim-R cloned repo under ~/.vim/bundle, and somehow Neovim and Nvim-R picked that up and tried to install the corresponding old nvimcom version (I have switched from Vim to Neovim some while ago). After removing the old Nvim-R repo and cleaning up any old nvimcom install in my R libPath, I updated Nvim-R via vim-plug and tried again.
However, now Nvim-R cannot complete the startup. I can see the R command line window showing up but not reaching the >
prompt of R, and something like "term://~//28227:R " displaying in the bottom. Whenever I tried to send any R code, the message says "Not ready yet", and it got stuck there.
Edited: OK, so I realized that I could go to the R command line window and press i
to enter insert mode, then I could see the >
prompt and interact with R (although still cannot send any code from the "editor" window), and I also see the message "nvimcom: Environment variable NVIMR_SECRET is missing." In my neovim config file, I have this line below to start R automatically when editing an R file, and I'm suspecting that this is causing the issue:
autocmd FileType r if string(g:SendCmdToR) == "function('SendCmdToR_fake')" | call StartR("R") | endif
Any suggestions as to how to resolve this? Thanks again.
I can replicate the same result. The problem is that the nclientserver
is started and the required environment variables to start R are set asynchronously. When you start R during the FileType event, the variables were not created yet.
I will see if it is simple to implement an auto-start option...
Actually, the option already exists: R_auto_start
.
R_auto_start
works! Sorry I missed that obvious option...
Thanks for your help and this wonderful plugin -- I've been heavily depending on it for the past 7 or 8 years of my life! That said many of my Nvim-R settings are inherited from quite old versions (like the autocmd
above) and I never touched them unless something broke. I probably should reread the documentation and update my settings...
Thanks for the feedback!
I have set up the latest Nvim-R (currently d8f7588) with Neovim v0.9.2 and R 4.2.1.
The issue I have is that each and every time I start Nvim-R, for some reason Nvim-R would try to rebuild and re-install nvimcom, but then there is the message "ERROR: R exit code = 1!".
:RDebugInfo
gives the messages below, apparently nvimcom has built and installed successfully, and there is only a cryptic error in the last line. However, this still leaves a locked 00LOCK-nvimcom repo dir in my libPath.I have to manually remove the locked dir before restart Neovim and Nvim-R (if I don't to this, I'll get an error message "Error opening '/R/x86_64-pc-linux-gnu-library/4.2/00LOCK-nvimcom/DESCRIPTION'" when I restart Nvim-R). This second time, Nvim-R would only try to update nvimcom and build the completion list, then R can start successfully and everything would work, but only for this time. If I then quit Neovim and restart, the same issue as described above repeats itself (i.e. fails every first time, works only every second time, etc.)
RDebugInfo:
First I cannot figure out why nvimcom installation failed the first time with the locked repo. Apparently every second time nvimcom would successfully install/update. Besides I'm not sure why nvimcom tries to reinstall itself each and every time... Honestly I would rather have an option to disable the auto update entirely, and if OK I'm ready to modify the source code to change this behavior for my install.
Any help on this is much appreciated.