Closed esaru closed 1 year ago
The error message says "have 'arm64', need 'x86_64'". Maybe R doesn't have the correct architecture for your system. With near zero experience with Mac OS, this is my guess.
that’s what i thought but it doesn’t explain why both R and RStudio start happily either on their own or via nvim (excepting RStudio via nvim). It’s specific to only nvim + RStudio, so it makes me think that its the environment which vim uses that may be part of the issue, unless nvim adds options to the R_cmd variable set in .vimrc, which i don’t think it does?
RStudio started by Nvim-R doesn't use either R_cmd
or R_app
variables. So, if you change the PATH
environment variable in your vimrc
and then set R_cmd
/R_app
, this will not work for RStudio. On Linux, RStudio gets the first R
in its path.
I added the Mac OS X
label to this issue because I can't fix it. If the issue is caused by a bug in Nvim-R, I need that someone does a pull request fixing it.
I miss-wrote R_cmd, when I meant RStudio_cmd. TL;DR: I'm closing this as it's not nvim-r's problem. It may be worth warning MacOS users not to update to the latest version of RStudio?
I've reported the bug to the rstudio github. It's on the side of their side of the operation. When calling RStudio as /Applications/RStudio.app/Contents/MacOS/RStudio from the shell, I get error 1, but the GUI starts. When I try to call it from within vim, as :!/Applications/RStudio.app/Contents/MacOS/RStudio, I get error 1 and error 2, the crash. If I try :!/Applications/R.app/Contents/MacOS/R, the CRAN GUI starts up just fine. It'n not being caused by something that's in .vimrc - happens without .vimrc, or a vanilla version, with my usual configuration. Happens in vim, mvim, and neovim. I'm quite sure this was induced by an update to RStudio, although I have not confirmed by a rollback.
Thanks for the feedback!
Following up - Found the problem. (edited to include vim/brew fix)
This is happening on an M1/arm64 running Ventura. The questions is why is RStudio incorrectly looking for an x86 library instead of an arm64 when the executable is called directly, but doesn't make this mistake when called by 'open'.
AFAIK when the executable is called directly, it doesn't load the environment files inside the app bundle. Since this showed up right after I updated RStudio, I was betting something is set in either an Info.plist or CodeResources file in the app bundle that prevents RStudio from making an incorrect assumption about the system architecture. (Eg. I thought RStudio was perhaps defaulting to x86 unless specified otherwise.)
This may be the cause of error_1, but not error_2: RStudio appears to be inheriting the architecture specification from the shell started by MacVim, which is set to x86 (I installed macvim using brew, no fancy options.) If one runs :ter, then arch, it's x86 and the RStudio executable fails in this shell. If one switches to arm64, eg :ter then 'arch --arm64 /Applications/RStudio.app/Contents/MacOS/RStudio', RStudio starts just fine.
The problem appears to be that I installed macvim/vim using brew which was carried over from before I switched to an M1, so after 'brew remove macvim', reinstalling brew as arm64, and reinstalling macvim, and fixing the path to put the new brew bin before the old brew x86 bin, everything worked, (although it continues to report the library confusion of error_1).
(Edited to move the error transcripts to separate files)
Hi:
I'm using MacVim, RStudio, NVim-R, all are up-to-date. MacOS Ventura.
Any clues to the solving the following? I can't get RStudio to boot from vim via Nvim. It's been working fine for years. However, this is the first time I've used nimv-r since I updated to Ventura.
What works:
RStudio works fine on it's own, CRAN's Aqua R GUI works fine, R in the shell works fine.
From MacVim + Nvim-RI can boot the R GUI and the shell R both as the tmux'd pane and as a separate external window.
When I try to boot RStudio from vim, however, I get the error attached as error_1.txt error_1.txt
But that may not be relevant. The fatal error is reported from RStudio as error_2.txt error_2.txt
Thanks for any direction on how to solve this.
Best, Eric