R 3.6 Shiny problem "Static path must not have trailing slash." - r

I just installed on my machine R 3.6 and tried to run my Shiny app and all of a sudden I get this error message:
Listening on http://10.81.197.170:1234
Error in makeTcpServer(host, port, private$appWrapper$onHeaders, private$appWrapper$onBodyData, :
Static path must not have trailing slash.
I tried to check what explained here Host shiny app on Windows but I do only have one single IP address.
I'm a very basic R user so I have no idea of what I could do to fix this problem. I also see another person had a similar issue a couple of months ago https://community.rstudio.com/t/error-using-a-shiny-app-on-windows-maketcpserver/64841 but he didn't get any answers.
Thanks for the help

This is difficult to answer specifically without seeing the code of your app.
However, I ran across the same error recently and will share what I did wrong and the fix, in case someone else got the error for the same reason I did.
In my app, I wanted to access data stored in a different folder from www, and to do this I had to add a resource path:
addResourcePath("myfolder","/foldername/")
data <- readxl::read_xlsx("myfolder/mydata.xlsx", sheet=1)
This worked when running the script locally, but not when it happened to be on a flash drive. That's when I got the error you describe above.
I also got it when using an absolute location for that folder:
addResourcePath("myfolder","E:/foldername/")
The fix was simple: remove the trailing backslash.
addResourcePath("myfolder","E:/foldername")
This may not be exactly your situation, but I'd look out for any instances where you're specifying directories to start out with.

Related

Shiny app working locally but not deployed on shinyapps.io

I'm in a difficult situation to figure out how to publish shiny app online.
Can't find any solution in the older questions.
The app works locally perfect but its impossible to put it online.
when I run the log, show just this:
Error in serverInfo(server) : server named 'rpubs.com' does not exist
on the part
"Markers": Line 14 - Paths should be to files within the project
directory. Error in sheets_fun(path) : Evaluation error:
path[1]="database.xls".
The file *.xlsx is already in the same folder of the *rmd.
Could any one help me I have no idea how to solve this issue. I'm now in two weeks trying to solve this.
that is to grab a job, and I will appreciate a lot if anyone tell me how to make it works

set path in rstudio

Can anyone please guide me setting up the path in rstudio, why I cant change present working directory. what if I want to save a file on desktop and pull up the file in Rstudio.
Your help is appreciated.
thanks, sandy
Some of the most common reasons I have found where setting directory was a problem with the solution
Forgot the "" marks around the path example of correct setwd("Libraries/Documents")
Working in Windows and forgot to switch the back-slash to a forward slash, examples: WRONG-> "Libraries\Documents" RIGHT->"Libraries/Documents"
There path is on a shared system where they system denies that access (we have remote folders on servers at work that cannot be addressed this way)...IT security
The directory is not actually mapped as you stated, example possibly you do not need the Libraries part or you have to expressly include another level of folders above your current address
The directory has a different name, a capital letter, a space in it or something making addressing it on your system difficult
You are actually already in the wanted directory. as joel said, try getwd() to see where it says you are.
If none of this is your problem, post the error message and your system (linux, OS10.?, Windows 7 pro) and they setwd("path_to_stuff") you are using and we can try to get to the heart of the matter better.

ShinyApp : Connection Reset By Peer

The shinyapp I built earlier was running fine in my old laptop. Recently I got a new laptop with Windows10. After setting up everything, I tried to run the app but it the browser opens and closes immediately with the error :
Listening on http://127.0.0.1:5004
ERROR: [on_request_read] connection reset by peer
I have also set chrome as default browser....
I deployed this app in shinyapps.io it is working fine there.
I tried few more simple apps in Rstudio but the same issue coming. Looks like the issue is more related to some setting in Windows10. Can someone help me please.
Thanks in Advance.....
Without details on the specific code, I'd share my personal experience with the same error for your reference. In my case, I used RStudio to create a shiny app that save data to a local directory on my computer, while I told R to output files to directory "response", I hadn't created such directory under the working directory so came the error. Simply creating the sub directory named "response" solve this right away. Or for moving your project files to different places in the future, you can just check whether the folder exists, if not, create one shall save you a lot of time.

why is dirname(sys.frame(1)$ofile) not working anymore

I have used
dirname(sys.frame(1)$ofile)
to get the directory of the script I am currently running
It worked perfectly until recently where it returns an error message
Error in sys.frame(1) : not that many frames on the stack
I have my code and data in Dropbox, and since I run it on various computers where dropbox is located differently, I want to be able to know where the script running is located.
Any idea why dirname(sys.frame(1)$ofile) does not work anymore, and how to get a solution.
There is a lot having the same problem as I, but the solutions either dont work or suggest another way which does not fit.

Can't Write Configuration File

I have been unsuccessful in getting Aptana 3.0.8 to start. I keep getting the error
The configuration area at 'C:\Users\Devon\.eclipse\com.aptana.rcp.product_3.0.8.201201201658_68819209\configuration' is not writable. Please choose a writable location using the '-configuration' command line option.
I have used the -configuration command within the target area of my shortcut to point to two different locations at two different times.
First I made a folder in the root of my drive and made sure that it was writable, but still got the same error, except it would say that the folder I specified was not writable instead of listing the folder in the above error.
I also tried to point it to write to a mapped network drive via my server and it still gave me the same error.
I have read other posts on this site and none of the resolutions solved my issue. I also went into my local appdata folder and changed the path of the default workspace location within the config.ini folder and changed it to a directory that does not have spaces in its name in hopes that would resolve the issue.
I really needed to work on my business website and thus have installed Aptana 2 in the mean time because that seems to be working without any issues. However I would really like to be able to get Aptana 3 working.
I am running Windows 7 Pro x64
Thanks in advance for any help provided here

Resources