After successfully loading blogdown and installing Hugo, I have trouble creating a new site with new_site(dir = 'test') in an empty 'test' folder. First, I get the following positive message:
Congratulations! Your new Hugo site is created in C:....\Dropbox\test.
Just a few more steps and you're ready to go:
Download a theme into the same-named folder.
or create your own with the "hugo new theme " command.
Perhaps you want to add some content. You can add single files
with "hugo new \.".
Start the built-in live server via "hugo server".
trying URL 'https://github.com/yihui/hugo-lithium-theme/archive/master.zip'
Content type 'application/zip' length 119666 bytes (116 KB)
downloaded 116 KB
Now comes the error msg.
Error in list.files(dir) : invalid 'path' argument
The current R session info gives this:
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] blogdown_0.0.35
loaded via a namespace (and not attached):
[1] bookdown_0.3.19 tools_3.3.2 rstudioapi_0.6 knitr_1.15.20
Any idea what I am doing wrong?
This should be a temporary bug that existed for a couple of hours. Please reinstall blogdown from Github:
devtools::install_github('rstudio/blogdown')
Related
When I install new version of Rstudio (the latest version: 2022.02.3-492),
many packages that were previously installed do not work.
enter image description here
Also, install.packages does not work due to "cannot open URL 'http://cran.rstudio.com/bin/windows/contrib/4.2/PACKAGES'"
First, I checked getOption("repos") and it prints
CRAN
"http://cran.rstudio.com/"
attr(,"RStudio")
[1] TRUE
Next, checked sessionInfo(), and it prints
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=Korean_Korea.utf8 LC_CTYPE=Korean_Korea.utf8
[3] LC_MONETARY=Korean_Korea.utf8 LC_NUMERIC=C
[5] LC_TIME=Korean_Korea.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.0 tools_4.2.0
Finally, checked my firewall blocker and allowed an application of RStudio R session.
However, none of them works.
It is making me crasy. How can I fix the problem?
In RStudio Go to Tools -> Global Options and in the Packages tab uncheck the box "use secure download method for HTTP".
Packages menu screenshot
This is similar to this issue, but the solutions mentioned didn't work for me. I tried to install TinyTeX via different methods:
tinytex::install_tinytex()
download TinyTeX-0.zip, and use tinytex:::install_prebuilt() on it
manually extract TinyTeX-0.zip (unzip() works) and run install-tl-windows (Batch file)
In the first two cases, I have this error:
Error in system2("tlmgr", args, ...) : '"tlmgr"' not found
In addition: Warning message:
In extract(pkg, exdir = path.expand(target)) :
error 1 in extracting from zip file
In the third case, the Windows console looks like this:
'\\crc\users\etienne\Desktop\TinyTeX-0\TinyTeX'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
and then closes without doing anything.
In every case, tinytex::is_tinytex() returns FALSE and tinytex::tlmgr_path() returns nothing.
I am working on Windows Server 2019 Standard (1809). What should I do?
> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252
[3] LC_MONETARY=French_France.1252 LC_NUMERIC=C
[5] LC_TIME=French_France.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.1.0 tools_4.1.0 tinytex_0.33.1 xfun_0.25
Solved in this GitHub issue
In summary:
run tinytex::install_tinytex(dir = "<path>") where <path> is a local folder on the server, e.g in my case "C:/Users/etienne/TinyTeX"
put options(tinytex.tlmgr.path = tinytex:::find_tlmgr("<path>")) in your .Rprofile (you can easily do that with usethis::edit_r_profile("user"))
restart R
check that tinytex::is_tinytex() is TRUE (you can also try to install a package with tinytex::tlmgr_install("booktabs") for instance)
I want to create a site using blogdown.
Following instructions in the 1.2 A quick example of blogdown eBook, of blogdown, I created a new project based on new directory then got the error below.
I just installed Hugo and blogdown so I guess it's not about the package version. I tried to look for information about the error message, and noticed that there are several questions related to blogdown::new_site(). I checked those but it seems like my problem is different. Hope that it won't be a bad question to ask. Please check the information below.
blogdown::new_site()
Then I got messages:
Congratulations! Your new Hugo site is created in D:\R_programming\t2.
Just a few more steps and you're ready to go:
Download a theme into the same-named folder. Choose a theme from https://themes.gohugo.io/, or create your own with the "hugo new
theme " command.
Perhaps you want to add some content. You can add single files with "hugo new \.".
Start the built-in live server via "hugo server".
Visit https://gohugo.io/ for quickstart guide and full documentation.
trying URL 'https://github.com/yihui/hugo-lithium/archive/master.zip'
downloaded 115 KB
Then here comes the error message.
Error in site_root(config) : Cannot find a website under the current
working directory or upper-level directories
This is a copy of my sessionInfo()
sessionInfo()
R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale: [1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 [2]
LC_CTYPE=Chinese (Traditional)_Taiwan.950 [3] LC_MONETARY=Chinese
(Traditional)_Taiwan.950 [4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Traditional)_Taiwan.950
attached base packages: [1] stats graphics grDevices utils
datasets methods base
loaded via a namespace (and not attached): [1] compiler_3.5.1
assertthat_0.2.0 bookdown_0.8 cli_1.0.1 [5] tools_3.5.1
withr_2.1.2 rstudioapi_0.8 yaml_2.2.0 [9] crayon_1.3.4
blogdown_0.9 knitr_1.21 xfun_0.4 [13]
sessioninfo_1.1.1
If I try to run blogdown::new_site() I get an error message I suspect being a linux/windows conversion problem of slashes maybe?
blogdown::new_site()
Congratulations! Your new Hugo site is created in D:\Documents\Blog.
Just a few more steps and you're ready to go:
1. Download a theme into the same-named folder.
Choose a theme from https://themes.gohugo.io/, or
create your own with the "hugo new theme <THEMENAME>" command.
2. Perhaps you want to add some content. You can add single files
with "hugo new <SECTIONNAME>\<FILENAME>.<FORMAT>".
3. Start the built-in live server via "hugo server".
Visit https://gohugo.io/ for quickstart guide and full documentation.
trying URL 'https://github.com/yihui/hugo-lithium-theme/archive/master.zip'
Content length 119078 bytes (116 KB)
downloaded 116 KB
Error in gsub(tmpdir, ".", zipdir) :
invalid regular expression '.\3aec55bc496d', reason 'Invalid back reference'
Don't quite get what's going on there... I the command on an empty directory and tied it via Rstudio also trying a different template gcushen/hugo-academic which caused the same error message...
I'm running R on a windows machine an all packages are up to date I believe...
sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] blogdown_0.5.9
loaded via a namespace (and not attached):
[1] compiler_3.4.3 bookdown_0.7 tools_3.4.3 yaml_2.1.18 knitr_1.20 xfun_0.1
As mentioned in my comment, this was indeed a bug in blogdown tracing back to differences in how Windows and Unix handle slashes in path names (or more specifically, differences in how tempfile() and utils::unzip() handle slashes in their output on Windows).
The issue should now be fixed as of version 0.5.10 of blogdown, which you can install using devtools::install_github("rstudio/blogdown").
I wanted to try packrat, but I ran into a warning and error message upon initializing it on a project:
> library(packrat)
> packrat::init()
Initializing packrat project in directory:
- "\\userhome/myuser/R_scripts/ratpack_test"
Adding these packages to packrat:
_
packrat 0.4.8-1
Fetching sources for packrat (0.4.8-1) ... OK (CRAN current)
Snapshot written to "\\userhome/myuser/R_scripts/ratpack_test/packrat/packrat.lock"
Installing packrat (0.4.8-1) ...
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/packrat_0.4.8-1.zip'
Content type 'application/zip' length 192726 bytes (188 KB)
downloaded 188 KB
OK (downloaded binary)
Initialization complete!
Warning message:
In Sys.junction(from, to) :
cannot set reparse point '\\userhome/myuser/R_scripts/ratpack_test/packrat/lib-R/base', reason 'Incorrect function'
Restarting R session...
Error in ensurePackageSymlink(source, target) :
Target '\\userhome/myuser/R_scripts/ratpack_test/packrat/lib-R/base' already exists and is not a symlink
It says cannot set reparse point 'my_custom_path', reason 'Incorrect function', and Target already exists and is not a symlink. Has anybody experienced a similar behavior? I'm running R 3.2.0 and Windows10.
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 x64 (build 9200)
locale:
[1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252 LC_MONETARY=German_Switzerland.1252 LC_NUMERIC=C
[5] LC_TIME=German_Switzerland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] packrat_0.4.8-1
loaded via a namespace (and not attached):
[1] tools_3.2.0