I have shiny app, which works perfectly fine on my local machine. I deployed the app on shiny-server running on centos-release-6-9.el6.12.3.x86_64
. The content of the application is loaded without any graphics as shown below:
And I get the following message in JS consol.
Loading failed for the <script> with source “http://mamged:3838/v01/shared/bootstrap/shim/respond.min.js”. v01:18:1
ReferenceError: Shiny is not defined[Learn More] v01:21:1
Loading failed for the <script> with source “http://mamged:3838/v01/shinyjs/shinyjs-default-funcs.js”. v01:38:1
ReferenceError: shinyjs is not defined[Learn More] v01:39:1
Loading failed for the <script> with source “http://mamged:3838/v01/message-handler.js”. v01:40:1
ReferenceError: jQuery is not defined[Learn More]
[Exception... "Favicon at "http://mamged:3838/favicon.ico" failed to load: Not Found." nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource:///modules/FaviconLoader.jsm :: onStopRequest :: line 156" data: no]
I am not sure what is going wrong.
EDIT
I have put some sample code to reproduce the example on the server.
server.r
# clear console
cat("\014")
# Defining the size of file to be accepted. -1 to accept any size.
options(shiny.maxRequestSize = -1)
# Clear workspace environment
rm(list = ls())
# set locale
Sys.setlocale('LC_ALL','C')
# main function
shinyServer(function(input, output,session) {
})
ui.r
library(shiny)
library(shinyjs)
filenames <- list.files(path = "data",pattern="\\.txt$")
names(filenames) <- gsub(pattern = "\\.txt$", "", filenames)
shinyUI(fluidPage(theme = "bootstrap.css",
(navbarPage("MAMGEDCDE",
position = c("fixed-top"),
fluid = TRUE, selected = "none",
navbarMenu("Help", icon = icon("fa fa-infocircle"),
tabPanel(
list(
a("Reference Manual",
target="_blank", href = "MAMGEDManual.pdf"),
a("GPLs Supported",
target="_blank", href="gpl.pdf"),
a("Video Tutorials",
downloadLink("AbsoluteExpression", " Absolute Expression", class=" fa fa-cloud-download"),
downloadLink("DifferentialExpression", " Differential Expression", class=" fa fa-cloud-download")
)
))
),
navbarMenu("Sample Data",
tabPanel(
list(
downloadLink("AffymetrixData", " Affymetrix", class=" fa fa-cloud-download"),
downloadLink("CodelinkData", " Codelink", class=" fa fa-cloud-download"),
downloadLink("IlluminaData", " Illumina", class=" fa fa-cloud-download")
))
),
navbarMenu("Stand-Alone Version", icon = icon("fa fa-infocircle"),
tabPanel(
list(
downloadLink("CodeandData", " MAMGED", class=" fa fa-cloud-download"),
a("Stand-alone Manual", target = "_blank", href= "Stand-alone.pdf")
)
)
)
)
),
br(),
br(),
useShinyjs(), ## initialize shinyjs to reset input files.
sidebarLayout(
sidebarPanel(
br(),
width = 4,
tabsetPanel(id = "tabs",
tabPanel(id = "tab1", value = "tab1",
h5("Upload Data Files"),
br(),
br(),
fileInput("files", label = "Upload Data Files",
multiple = "TRUE",
accept=c('text/csv','text/comma-separated-values,
text/plain', '.csv','.cel','.TXT','.txt', '.zip')),
uiOutput('Display_source_data'),
br(),
textInput("mailid", "Enter Email ID", placeholder = "Enter your email id")
),
tabPanel(id = "tab2", value= "tab2",
h5("Download Data",style="bold"),
br(),
br(),
br(),
textInput("jobid", "Enter Job ID", placeholder = "Enter your job id")
)),
br(),
br(),
tags$head(tags$script(src = "message-handler.js")),
fluidRow(
conditionalPanel(
condition = "input.tabs == 'tab1'",
column(4,
actionButton("Submit", label = "Submit"))
),
conditionalPanel(
condition = "input.tabs == 'tab2'",
br(),
column(4,
uiOutput("button")
)),
column(4,
actionButton("Reset_Input", label = "Reset"))
),
br()
),
mainPanel(
titlePanel(
headerPanel(
h2( "Analysis of Microarray Gene Expression Data",
align="center", style="bold"
)
)
),
h5("test page")
)
)
))
It works fine on the local machine.
One more thing, do I need to install r packages by using sudo -i R
to make it work. I installed all the packages without sudo
.