[問題] SHINY 電腦還原後 如何重新佈署

看板R_Language作者 (asdfrtg)時間8年前 (2017/11/19 20:44), 8年前編輯推噓0(0012)
留言12則, 2人參與, 8年前最新討論串1/1
[問題類型]: 程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來) [軟體熟悉度]: 新手(沒寫過程式,R 是我的第一次) [問題敘述]: 在電腦系統還原之後想要更新之前shiny的作品上傳至shinyapps.io 但是卻無法更新 https://imgur.com/a/BDcuc / s [環境敘述]: 安裝shiny 及devtools 執行 devtools::install_github('rstudio/shinyapps') devtools::install_github('rstudio/rscrypt') [關鍵字]: shiny 重新佈署 選擇性,也許未來有用 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 49.214.135.85 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1511095463.A.CFD.html clsmbstu: 1. 你要部署的檔案們都在working directory嗎? 我有把SERVER跟UI放在同一個資料夾裡面@@ 11/19 23:41

11/19 23:42, 8年前 , 1F
2. 我不確定token需不需要重新驗證,你可以試試?
11/19 23:42, 1F
token 是指rsconnect::setAccountInfo這之後的貼到RSTUDIO裡面嗎@@? 我是過這樣也出現依樣錯誤 ※ 編輯: asdfrtg (49.214.135.85), 11/20/2017 01:25:49

11/20 12:49, 8年前 , 2F
你看一下rsconnect::deployApp的說明,第一個參數就是要
11/20 12:49, 2F

11/20 12:50, 8年前 , 3F
放你的server.R和ui.R的所在資料夾。預設是getwd()。
11/20 12:50, 3F

11/20 12:50, 8年前 , 4F
從你截圖中可以看出來你現在的working directory是家目
11/20 12:50, 4F

11/20 12:51, 8年前 , 5F
錄(你可以執行getwd()確認),如果你的server和ui不是
11/20 12:51, 5F

11/20 12:51, 8年前 , 6F
放在這裡,那理所當然會失敗。
11/20 12:51, 6F

11/20 12:52, 8年前 , 7F
兩個方法:
11/20 12:52, 7F

11/20 12:53, 8年前 , 8F
1. 直接把你放server和ui的完整路徑給deployApp()
11/20 12:53, 8F

11/20 12:54, 8年前 , 9F
2. 先用setwd()把你的working directory改掉,再直接執
11/20 12:54, 9F

11/20 12:55, 8年前 , 10F
行deployApp()。
11/20 12:55, 10F
了解 好像是因為原本的目錄無法變成working directory 之後發現原本的TOCKEN執行之後無法認證出現此錯誤 Error in function (type, msg, asError = TRUE) : SSL certificate problem: unable to get local issuer certificate 是要在新增一個token還是?@@ ※ 編輯: asdfrtg (49.214.135.85), 11/20/2017 13:57:05

11/20 14:03, 8年前 , 11F
這我沒遇過欸 你可以試試看 或Google一下錯誤訊息 @@
11/20 14:03, 11F

11/21 16:39, 8年前 , 12F
謝謝clsmbstu大大 我先建立新的資料夾 重建ui 跟server
11/21 16:39, 12F
再用setwd()之後就成功了!! ※ 編輯: asdfrtg (1.34.233.124), 11/21/2017 16:41:25 不過後來部署完之後 Error : You must register an account using setAccountInfo prior to proceeding. 出現這樣的錯誤 在程式碼中有用了rsconnect::setAccountInfo 不知道怎修正@@ ※ 編輯: asdfrtg (1.34.233.124), 11/21/2017 17:24:58
文章代碼(AID): #1Q4Nodpz (R_Language)
文章代碼(AID): #1Q4Nodpz (R_Language)