Build tools - site directory

I am receiving the following error when using 'Build' in RStudio server:

Error in file(filename, "r", encoding = encoding) : 
  cannot open the connection
Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> source -> file
Execution halted

Exited with status 1.

I understand that this means knit cannot find a file in the same directory as my Rmd file.

To test I have only index.html listed in _site.yml and both the yml file and index.Rmd are in a folder 'webfiles' . The index.Rmd file is just plain text, it does not source anything in a different folder (which is a common cause of the error message according to other threads).

The only cause I can think of is the fact that I am using a symbolic link to the folder holding the files but I cannot get any further than that.

From the console:

> getwd()
[1] "/var/unis/survey"

Tools > Project Options > Build Tools, the site directory is:
/var/unis/survey/webfiles

In the RStudio IDE, I access the project files using the symbolic link so the Files panel path shows:
Home > unissym > unis > survey > webfiles

So I'm guessing I am not understanding how the file paths are working and any help would be most appreciated.

1 Like

@dena A few questions to help troubleshoot the issue you are having:

  1. What operating system are you using? Which version of R? Which version of R Markdown?
  2. What error message do you get if you run rmarkdown::render_site("webfiles") in the R console? Is it the same error message as you get from RStudio Server?
  3. Could you try creating a test setup that doesn't use a symlink? This will let us know if it is the symlink that is causing the problem or something else.

Hello

many thanks for the reply and I apologise for the delay in replying. It turned out to be an error in the code of a shared file, several people are contributing. I am sorry to have wasted your time posting the problem.

1 Like

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.