rstudio / blogdown

Create Blogs and Websites with R Markdown
https://pkgs.rstudio.com/blogdown/
1.73k stars 335 forks source link

addins result in error #72

Closed pssguy closed 7 years ago

pssguy commented 7 years ago

As per book

Trying to use addins gettng similar errors with both 'Update metadata' and 'New post'

e.g addinissue

On pressing done button

> blogdown:::update_meta_addin()

Listening on http://127.0.0.1:4554
Warning: Error in .Call: Incorrect number of arguments (8), expecting 7 for 'as.yaml'
Stack trace (innermost first):
    81: yaml::as.yaml
    80: blogdown:::as.yaml
    79: f
    78: callFun
    77: rstudioapi::modifyRange
    76: observeEventHandler
    12: shiny::runApp
    11: shiny::runGadget
    10: eval
     9: eval
     8: eval
     7: eval
     6: eval.parent
     5: local
     4: eval
     3: eval
     2: sys.source
     1: blogdown:::update_meta_addin

Nothing changes to file and the packages category does not appear when trying again blogdown v 0,0.25

yihui commented 7 years ago

Please always include devtools::session_info('blogdown') when reporting an issue.

pssguy commented 7 years ago

@yihui Sorry about that. Here you go

devtools::session_info('blogdown') Session info ----------------------------------------------------------- setting value
version R version 3.3.2 (2016-10-31) system x86_64, mingw32
ui RStudio (1.0.136)
language (EN)
collate English_Canada.1252
tz America/Los_Angeles
date 2017-03-15

Packages --------------------------------------------------------------- package * version date source
backports 1.0.5 2017-01-18 CRAN (R 3.3.1)
base64enc 0.1-3 2015-07-28 CRAN (R 3.3.0)
bitops 1.0-6 2013-08-17 CRAN (R 3.1.1)
blogdown 0.0.25 2017-03-15 Github (rstudio/blogdown@a894557) bookdown 0.3.14 2017-03-15 Github (rstudio/bookdown@3025188) caTools 1.17.1 2014-09-10 CRAN (R 3.1.1)
digest 0.6.12 2017-01-27 CRAN (R 3.3.1)
evaluate 0.10 2016-10-11 CRAN (R 3.3.1)
highr 0.6 2016-05-09 CRAN (R 3.2.4)
htmltools 0.3.5 2016-03-21 CRAN (R 3.3.0)
httpuv 1.3.3 2015-08-04 CRAN (R 3.3.0)
jsonlite 1.3 2017-02-28 CRAN (R 3.3.2)
knitr 1.15.1 2016-11-22 CRAN (R 3.3.2)
magrittr 1.5 2014-11-22 CRAN (R 3.3.0)
markdown 0.7.7 2015-04-22 CRAN (R 3.2.0)
mime 0.5 2016-07-07 CRAN (R 3.3.1)
Rcpp 0.12.9 2017-01-14 CRAN (R 3.3.2)
rmarkdown 1.3 2016-12-21 CRAN (R 3.3.2)
rprojroot 1.2 2017-01-16 CRAN (R 3.3.1)
servr 0.5 2016-12-10 CRAN (R 3.3.2)
stringi 1.1.2 2016-10-01 CRAN (R 3.3.1)
stringr 1.2.0 2017-02-18 CRAN (R 3.3.2)
yaml 2.1.14 2016-11-12 CRAN (R 3.3.1)

yihui commented 7 years ago

I cannot reproduce the issue. Could provide a reproducible example? Before you install blogdown, did you restart your R session? It is good practice to always restart your R session before you install packages.

pssguy commented 7 years ago

Not sure how you do a reproducible example of pressing a button?

I create a new project then

Click for process Restarting R session... > devtools::install_github("rstudio/blogdown", force=TRUE) Downloading GitHub repo rstudio/blogdown@master from URL https://api.github.com/repos/rstudio/blogdown/zipball/master Installing blogdown "C:/PROGRA~1/R/R-33~1.2/bin/x64/R" --no-site-file --no-environ --no-save --no-restore \ --quiet CMD INSTALL \ "C:/Users/Andrew/AppData/Local/Temp/RtmpErPTzM/devtools29083a162828/rstudio-blogdown-a894557" \ --library="C:/Users/Andrew/Documents/R/win-library/3.3" --install-tests * installing *source* package 'blogdown' ... ** R ** inst ** tests ** preparing package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded *** arch - i386 *** arch - x64 * DONE (blogdown) Restarting R session... > blogdown::new_site() trying URL 'https://github.com/yihui/hugo-lithium-theme/archive/master.zip' Content type 'application/zip' length 118173 bytes (115 KB) downloaded 115 KB Started building sites ... Built site for language en: 0 draft content 0 future content 0 expired content 4 regular pages created 8 other pages created 0 non-page files copied 0 paginator pages created 3 tags created 1 categories created total in 94 ms > blogdown:::update_meta_addin() Loading required package: shiny Listening on http://127.0.0.1:3163 Warning: Error in .Call: Incorrect number of arguments (8), expecting 7 for 'as.yaml' Stack trace (innermost first): 81: yaml::as.yaml 80: blogdown:::as.yaml 79: f 78: callFun 77: rstudioapi::modifyRange 76: observeEventHandler 12: shiny::runApp 11: shiny::runGadget 10: eval 9: eval 8: eval 7: eval 6: eval.parent 5: local 4: eval 3: eval 2: sys.source 1: blogdown:::update_meta_addin ERROR: [on_request_read] connection reset by peer > devtools::session_info('blogdown') Session info --------------------------------------------------------------------------------- setting value version R version 3.3.2 (2016-10-31) system x86_64, mingw32 ui RStudio (1.0.136) language (EN) collate English_Canada.1252 tz America/Los_Angeles date 2017-03-16 Packages ------------------------------------------------------------------------------------- package * version date source backports 1.0.5 2017-01-18 CRAN (R 3.3.1) base64enc 0.1-3 2015-07-28 CRAN (R 3.3.0) bitops 1.0-6 2013-08-17 CRAN (R 3.1.1) blogdown 0.0.25 2017-03-16 Github (rstudio/blogdown@a894557) bookdown 0.3.14 2017-03-15 Github (rstudio/bookdown@3025188) caTools 1.17.1 2014-09-10 CRAN (R 3.1.1) digest 0.6.12 2017-01-27 CRAN (R 3.3.1) evaluate 0.10 2016-10-11 CRAN (R 3.3.1) highr 0.6 2016-05-09 CRAN (R 3.2.4) htmltools 0.3.5 2016-03-21 CRAN (R 3.3.0) httpuv 1.3.3 2015-08-04 CRAN (R 3.3.0) jsonlite 1.3 2017-02-28 CRAN (R 3.3.2) knitr 1.15.1 2016-11-22 CRAN (R 3.3.2) magrittr 1.5 2014-11-22 CRAN (R 3.3.0) markdown 0.7.7 2015-04-22 CRAN (R 3.2.0) mime 0.5 2016-07-07 CRAN (R 3.3.1) Rcpp 0.12.9 2017-01-14 CRAN (R 3.3.2) rmarkdown 1.3 2016-12-21 CRAN (R 3.3.2) rprojroot 1.2 2017-01-16 CRAN (R 3.3.1) servr 0.5 2016-12-10 CRAN (R 3.3.2) stringi 1.1.2 2016-10-01 CRAN (R 3.3.1) stringr 1.2.0 2017-02-18 CRAN (R 3.3.2) yaml 2.1.14 2016-11-12 CRAN (R 3.3.1) >
yihui commented 7 years ago

What is your output of yaml::as.yaml?

pssguy commented 7 years ago
function (x, line.sep = c("\n", "\r\n", "\r"), indent = 2, omap = FALSE, 
    column.major = TRUE, unicode = TRUE, precision = getOption("digits"), 
    indent.mapping.sequence = FALSE) 
{
    line.sep <- match.arg(line.sep)
    .Call("as.yaml", x, line.sep, indent, omap, column.major, 
        unicode, precision, indent.mapping.sequence, PACKAGE = "yaml")
}
<environment: namespace:yaml>
yihui commented 7 years ago

That is really weird. Could you restart your R session, install.packages('yaml') and devtools::install_github('rstudio/blogdown')?

pssguy commented 7 years ago

That seems to have done trick. Can create and select categories in update_meta_addin() and create new posts. Entering new category within post means it is then available for selection in pop-up addin next time Is there anything I can send to you to help explain it?

yihui commented 7 years ago

My best guess is there was some trouble with installing yaml last time (libs/yaml.dll might be locked). As I said in my second reply, you'd better restart your R session every time before you install any packages (especially on Windows).

pssguy commented 7 years ago

I usually do but, must admit, not always. Having a reminder on RStudio IDE Install Packages popup would be helpful Thanks again