作者rlearner (rlearner)
看板Linux
標題[問題]ubuntu server上建立r-leaflet套件
時間Wed Dec 14 11:10:49 2016
這個問題不知能不在該板題問@@
[環境架設/問題簡敘]
我在實體機上ubuntu上架設了shiny server
測試用的shiny範例程式所放路徑:
$cd /opt/shiny-server/samples/sample-apps
並放了幾個範例程式,如下
http://140.128.197.58:3838/sample-apps/
(問題所在!!!!)但在嘗試leaflet地圖套件時出錯:
http://140.128.197.58:3838/sample-apps/leaflet1/
ps.不過leaflet應用在js上就可以了@_@
http://140.128.197.58:3838/sample-apps/html-samples/leaflet.html
[程式碼]
以下是
http://140.128.197.58:3838/sample-apps/leaflet1/
的程式碼,直接放上rstudio跑是沒問題的
ui.R------------------------------------------
library(leaflet)
library(shiny)
fluidPage(
h1("hpc map test"),
leafletOutput('map',width = "100%",height = 800)
)
server.R----------------------------------
library(shiny)
library(leaflet)
function(input,output){
output$map <- renderLeaflet({
leaflet() %>%
addTiles() %>%
setView(lng=120.601,lat=24.179,zoom=16)
})
}
[錯誤訊息]
1.網頁訊息
點入剛剛講的
http://140.128.197.58:3838/sample-apps/leaflet1/
的網址會出現如下的錯誤訊息:
ERROR: An error has occurred. Check your logs or contact the app author for
clarification.
2.按F12選console,出現錯誤訊息
Failed to load resource: the server responded with a status of 500 (Internal
Server Error)
3.去伺服器進入cd /var/log/shiny-server
並無leaflet相關的錯訊息訊
[環境版本]
ubuntu 14.04.05
shiny-server 1.5.1
R 3.3.2
leaflet 1.0.1
不知道該如何處理,求解QQ!!
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.128.101.143
※ 文章網址: https://www.ptt.cc/bbs/Linux/M.1481685052.A.5CA.html
→ andy12345638: 伺服器端的R確定有裝leaflet套件了嗎 12/14 16:19
→ andy12345638: 我上次遇到類似問題 要看錯誤訊息的方式是 12/14 16:19
→ andy12345638: 直接在伺服器端用R+runApp 看終端機顯示什麼即可 12/14 16:20
→ rlearner: 我在R裡面可以library(leaflet),這應該算有成功下載了嗎 12/14 16:40
→ andy12345638: 恩沒錯,那應該代表有成功載入了,改用runApp看看吧 12/14 16:43
→ rlearner: runapp過了 12/14 17:06
→ rlearner: 我不會插圖QQ 12/14 17:06