rapache with open tag <% throws "unexpected <"

64 views
Skip to first unread message

Alexander Schestag

unread,
Dec 19, 2014, 6:34:14 AM12/19/14
to rap...@googlegroups.com
Hi all,

I installed the latest rapache module, and everything works fine - until I use the open tag <%. Then I get the following error:

Error in parse(n = -1, file = file, srcfile = NULL, keep.source = FALSE) :
  1:1: unexpected '<'
1: <
    ^
Traceback:
2: parse(n = -1, file = file, srcfile = NULL, keep.source = FALSE)
1: sys.source(file = "/var/www/R/test.R", envir = .rAenv)

What could be wrong?

Alex

Jeffrey Horner

unread,
Dec 19, 2014, 9:16:08 AM12/19/14
to rap...@googlegroups.com
Install the brew package,and then add 'library(brew)' to your code.

--
You received this message because you are subscribed to the Google Groups "rapache" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rapache+u...@googlegroups.com.
To post to this group, send email to rap...@googlegroups.com.
Visit this group at http://groups.google.com/group/rapache.
For more options, visit https://groups.google.com/d/optout.



--

Alexander Schestag

unread,
Dec 19, 2014, 4:24:26 PM12/19/14
to rap...@googlegroups.com

Thanks for your answer. I did that and still get the error.

Example code:

ibrary(brew,4)
<%
print('Hello World!')
%>

Error:

1: sys.source(file = "/var/www/R/test/brew/search.rhtml", envir = .rAenv)
[Fri Dec 19 22:15:39 2014] [error] [client 127.0.0.1] rApache Notice!

Error in parse(n = -1, file = file, srcfile = NULL, keep.source = FALSE) :
  2:1: unexpected '<'
1: library(brew,4)
2: <

Alexander Schestag

unread,
Dec 19, 2014, 4:26:23 PM12/19/14
to rap...@googlegroups.com


Am Freitag, 19. Dezember 2014 22:24:26 UTC+1 schrieb Alexander Schestag:

Thanks for your answer. I did that and still get the error.

Example code:

ibrary(brew,4)

Edit: of course, it's library, not ibrary. That was just a pasting error.

Alexander Schestag

unread,
Dec 19, 2014, 7:49:26 PM12/19/14
to rap...@googlegroups.com


Ok, found the error. Was a wrong RHandler in the Apache config.

bernard

unread,
Jun 15, 2015, 7:12:20 PM6/15/15
to rap...@googlegroups.com
I am having the same problem but I can see what is wrong with my rapache config,

Here is my brew configuration

<Directory /srv/www/RWeb/R/brew>
    SetHandler r-script
    RHandler brew::brew
</Directory>

and the test r-scrpt is the same as op's and is placed under /srv/www/RWeb/R/brew/

I have also configured brew to start by adding the following to my configuration

REvalOnStartup "library(DBI); library(RMySQL); library(brew); library(Cairo); library(ggplot2)"


Can anyone help? Thanks

P.S. It is very frustrating that people solved their problem and then just left without telling how they solved it

bernard

unread,
Jun 15, 2015, 7:34:50 PM6/15/15
to rap...@googlegroups.com
There is apparently because of

<location /R>
 ROutputErrors
 SetHandler r-script
 RHandler sys.source
</location>

comment this out in config file then the error disappears. But then other scripts would not run

bernard

unread,
Jun 15, 2015, 9:58:03 PM6/15/15
to rap...@googlegroups.com
Figured it out

Changing <location to <directory directive of the above block in apache's config file solved the problem

<directory /path/to/r/scripts>
 SetHandler r-script
 RHandler sys.source
</directory>
Reply all
Reply to author
Forward
0 new messages