2014-10-17 133 views
1

我在centos 6上使用shiny-server,它適用於大多數應用程序,但出現問題 當我使用它與rCharts(ggplot2是好的)。 chrome給我一條消息:「無法加載資源:服務器響應的狀態爲500(內部服務器錯誤)」,但我可以在本地Windows7系統上運行相同的代碼,並且沒有錯誤日誌。它出什麼問題了。 如果有朋友知道如何處理它,請告訴我,謝謝。shiny-server無法加載資源:服務器響應狀態爲500(內部服務器錯誤)

代碼:

server.R

require(rCharts) 
shinyServer(function(input, output) { 
    output$myChart <- renderChart({ 
    names(iris) = gsub("\\.", "", names(iris)) 
    p1 <- rPlot(input$x, input$y, data = iris, color = "Species", 
     facet = "Species", type = 'point') 
    p1$addParams(dom = 'myChart') 
    return(p1) 
    }) 
}) 

#ui.R 
require(rCharts) 
shinyUI(pageWithSidebar(
    headerPanel("rCharts: Interactive Charts from R using polychart.js"), 

    sidebarPanel(
    selectInput(inputId = "x", 
    label = "Choose X", 
    choices = c('SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth'), 
    selected = "SepalLength"), 
    selectInput(inputId = "y", 
     label = "Choose Y", 
     choices = c('SepalLength', 'SepalWidth', 'PetalLength', 'PetalWidth'), 
     selected = "SepalWidth") 
), 
    mainPanel(
    showOutput("myChart", "polycharts") 
) 
)) 

回答

0

是啊,我終於檢查出來,因爲我還沒有改變應用程序的模式(ui.R和server.R)! 以可讀的模式!在ui.R和server.R的chmod 755之後,它運行良好。

相關問題