我已经陷入了一个兔子洞,试图设置 Github 操作来检查我的包的构建usethis::use_github_action_check_standard()
。该函数在尝试从r-lib.yaml
存储库中提取文件 时失败。我一直试图弄清楚为什么对我来说失败了。似乎对于来自 Github 的任何文件都失败了,但对于来自其他位置的文件确实有效。readLines()
readLines()
##
## random .txt file works
##
readLines("https://filesamples.com/samples/document/txt/sample1.txt")
#> Warning in readLines("https://filesamples.com/samples/document/txt/
#> sample1.txt"): incomplete final line found on 'https://filesamples.com/samples/
#> document/txt/sample1.txt'
#> [1] "Utilitatis causa amicitia est quaesita."
#> [2] "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Collatio igitur ista te nihil iuvat. Honesta oratio, Socratica, Platonis etiam. Primum in nostrane potestate est, quid meminerimus? Duo Reges: constructio interrete. Quid, si etiam iucunda memoria est praeteritorum malorum? Si quidem, inquit, tollerem, sed relinquo. An nisi populari fama?"
#> [3] ""
#> [4] "Quamquam id quidem licebit iis existimare, qui legerint. Summum a vobis bonum voluptas dicitur. At hoc in eo M. Refert tamen, quo modo. Quid sequatur, quid repugnet, vident. Iam id ipsum absurdum, maximum malum neglegi."
#
##
## random .yaml file also works (very long, not showing output)
##
# readLines("https://wg21.link/index.yaml")
##
## .yaml file from github does not work
##
readLines("https://raw.githubusercontent.com/r-lib/actions/master/examples/check-standard.yaml", encoding = "UTF-8")
#> Warning in file(con, "r"): InternetOpenUrl failed: 'A connection with the server
#> could not be established'
#> Error in file(con, "r"): cannot open the connection
##
## .txt file from github does not work
##
readLines("https://raw.githubusercontent.com/neslib/Neslib.Yaml/master/License.txt")
#> Warning in file(con, "r"): InternetOpenUrl failed: 'A connection with the server
#> could not be established'
#> Error in file(con, "r"): cannot open the connection
我尝试Use Internet Explorer library/proxy for HTTP
在 RStudio 选项中选中和取消选中无效。
由reprex 包于 2021-08-05 创建 (v2.0.0 )