Closed dkgaraujo closed 2 years ago
Thanks for reporting! I think I've seen the same error of "Unknown language engine 'extendr'" on my Linux, but didn't have time to file an issue at that time (sorry).
Regarding this error,
sh: cargo: command not found
this indicates you need to add ~/.cargo/bin
to your PATH
. Typically, including PATH="~/.cargo/bin:${PATH}"
in your ~/.Renviron
will fix this. (See https://github.com/extendr/libR-sys/issues/54 for the related discussions. I don't know why this tends to happen on macOS...)
@clauswilke
Do extendr
chunks work on your environment? I'm suspecting something changed on knitr's side after we implemented extendr engine.
Thanks for reporting! I think I've seen the same error of "Unknown language engine 'extendr'" on my Linux, but didn't have time to file an issue at that time (sorry).
Regarding this error,
sh: cargo: command not found
this indicates you need to add
~/.cargo/bin
to yourPATH
. Typically, includingPATH="~/.cargo/bin:${PATH}"
in your~/.Renviron
will fix this. (See extendr/libR-sys#54 for the related discussions. I don't know why this tends to happen on macOS...)
Many thanks @yutannihilation! The code rust_function()
code now works, although the code chunk in knitr is still not working successfully (same msg as above).
Before making any comments, I'd like to see a fully reproducible example. The {rextendr} package needs to be loaded before the first extendr chunk. If that isn't done I'd expect knitr to fail.
Our regression suite still runs without problems, so knitr chunks work as far as I can tell. https://github.com/extendr/rextendr/runs/3984897049?check_suite_focus=true
Thanks very much @clauswilke for jumping in and @yutannihilation again for the helpful pointers. As I was preparing a reprex of the knittr situation, I noted it did work now. Maybe it somehow needed me to close the R session to reflect the addition of ~/.cargo/bin to PATH, I don' know. It is working perfectly now. Thanks again!
Separately, do you think it would be necessary to slightly adjust the installation instructions for macOS users that they might need to add ~/.cargo/bin to PATH?
Our regression suite still runs without problems, so knitr chunks work as far as I can tell.
Oh, true, thanks. I think I struggled to make extendr
chunk work when I was writing a blog post about extendr, but it seems it was just my misunderstanding of something. Sorry for the noise.
Separately, do you think it would be necessary to slightly adjust the installation instructions for macOS users that they might need to add ~/.cargo/bin to PATH?
We are discussing about the better setup here: https://github.com/extendr/rextendr/issues/100.
Hi all, first off thanks for binding these two very complementary languages, I'm looking forward to harnessing their respective powers together. But unfortunately so far I haven't been able to make it work even with simple examples. I already had well-functioning R (4.0.2) and rust (1.55.0) installations.
Here's the sequential steps I undertook, all successful, and with no hint of errors or incomplete installations:
1) in R:
install.packages("rextendr")
2) in the terminal:git clone https://www.github.com/extendr/libR-sys
then, in the libR-sys folder,cargo build
. (It did return warnings, but no errors; the warnings were about theunsafe
part of the code.)But, here are the results of the basic examples provided in the extendr page:
(The output slide was created but that code chunk above didn't produced any output whereas other chunks did as expected. I didn't want to register in knit_engines without first knowing what was going on.)
Any pointer into how to solve the above is greatly appreciated! Thanks very much in advance!