1

I am using the last version on LYX 2.0.5.1 and RStudio 0.97.318. I have installed knitr in R, my /usr/bin/Rscript is in PATH prefix in LYX, but I still fail to run even example files knitr.lyx. The error I get is:

An error occurred while running:
Rscript --verbose --no-save --no-restore
"/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R"
"/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL9170/lyx_tmpb...

I changed lyxknitr.R to other versions listed on the official cite, it does not work with them either. When I did the similar things on Windows 7, it runs ok. I tried to reinstall lyx, it did not help. What else can I do?

Thanks!

UPDATE: I installed the stringer package in R, reconfigured, but Lyx still gives and error:

12:24:25.747: Rscript --verbose --no-save --no-restore "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL2777/lyx_tmpbuf3/""knitr.Rnw" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL2777/lyx_tmpbuf3/""knitr.tex" ISO-8859-15 "/Users/Natasha/Stats315b/HW1/"
12:24:25.749: running
12:24:25.758:   '/Library/Frameworks/R.framework/Versions/2.15/Resources/bin/R --slave --no-restore --no-save --no-restore --file=/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R --args /var/folders/ls/
12:24:25.759: mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL2777/lyx_tmpbuf3/knitr.Rnw /var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL2777/lyx_tmpbuf3/knitr.tex ISO-8859-15'
12:24:25.759: 
12:24:25.946: Error in loadNamespace(i, c(lib.loc, .libPaths())) : 
12:24:25.951:   there is no package called 'stringr'
12:24:25.957: Error: package/namespace load failed for 'knitr'
12:24:25.957: Execution halted

Running: Rscript --verbose --no-save --no-restore "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL2777/lyx_tmpbuf3/""knitr.Rnw" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL2777/lyx_tmpbuf3/""knitr.tex" ISO-8859-15 "/Users/Natasha/Stats315b/HW1/"
support/Systemcall.cpp (273): Systemcall: 'Rscript --verbose --no-save --no-restore "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL2777/lyx_tmpbuf3/""knitr.Rnw" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL2777/lyx_tmpbuf3/""knitr.tex" ISO-8859-15 "/Users/Natasha/Stats315b/HW1/"' finished with exit code 1
Error: Cannot convert file
----------------------------------------
An error occurred while running:
Rscript --verbose --no-save --no-restore
"/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R"
"/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL2777/lyx_tmpb...
12:24:27.545: Error while previewing format: pdf2

I did not have to install stringr under windows and it worked ok. Thanks for help!

Hobbit
  • 31
  • 3
  • There are a couple of problems with LyX + knitr that I think will be fixed in 2.0.6. If you have access to Ubuntu, I could tell you how to install the current (not released yet) version. Otherwise, either write to lyx-users@lists.lyx.org or wait a few weeks for 2.0.6. – scottkosty Apr 20 '13 at 22:04
  • Whenever errors occur, look at the messages from menu `View => View Messages`. The error dialog box is useless. (To @scottkosty, perhaps we need to capture the real error message from the converter) – Yihui Xie Apr 21 '13 at 01:03
  • @Yihui yes, that would be nice. I guess that all of STDERR from a converter should be shown? Or at least accessible through a "More Info" button. – scottkosty Apr 21 '13 at 01:11
  • I looked at the View Messages box, it gives some extra information: `An error occurred while running: Rscript --verbose --no-save --no-restore "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" "/var/folders/ls/mbs_stj505lc25gj2m7h5h100000gn/T/lyx_tmpdir.JL9170/lyx_tmpb... 10:39:51.322: Error while previewing format: pdf2` Thanks to all! – Hobbit Apr 21 '13 at 06:41
  • @Hobbit we need more messages before that; please edit your post and paste the full log there – Yihui Xie Apr 24 '13 at 02:03
  • @Yihui, I updated the post by adding a full log of error I get. I did not see earlier that it wants stringr package, so I installed it and reconfigured Lyx. But it does not seem working again. Hope my message helps to resolve what has happened. – Hobbit Apr 26 '13 at 08:31
  • @Hobbit Please `install.packages('knitr')` – Yihui Xie Apr 27 '13 at 13:39

0 Answers0