brew::brew does not work

170 views
Skip to first unread message

RapacheLover

unread,
Apr 21, 2011, 5:20:06 PM4/21/11
to rapache
Hello,

I am almost there with my Apache2/R configuration but got stuck with
brew.

Somehow this does not work in my apache2.conf file

<Directory /var/www/brew>
SetHandler r-script
RHandler brew::brew
</Directory>

I can see the RapacheInfo page so I am assuming the R is working fine,
however, I am not able to run any .r, .R or .rhtml files via http. I
went through the manual few times without much success. I have this
directive also in the config file

<Directory /var/www/R-files>
SetHandler r-script
RHandler sys.source
</Directory>

but the .r, .R or .rhtml files do not get parsed. I only see the code
not the result in the browser.

Thank you in advance for any help.

Regards,

Jeffrey

unread,
Apr 21, 2011, 5:29:51 PM4/21/11
to rapache
What OS are you running? Is it Linux? What distribution.

It's best to place those directives in /etc/apache2/sites-enabled/
default or some such. Also if your brew or sys.source files will
always return html then you can do something like this to force the
mime type:
<Directory /var/www/brew>
        SetHandler r-script
        RHandler brew::brew
DefaultType text/html
</Directory>

As to why it's not parsing your file, make sure you have brew
installed... Other than that check your log file for any R related
errors.

Jeff

RapacheLover

unread,
Apr 21, 2011, 8:37:00 PM4/21/11
to rapache
Thanks for your reply Jeff.

I am using Rapache on Linux Ubuntu on a 32 bit hardware.

I went through the 100 most recent posts and one of your posts states:

R CMD INSTALL -l /usr/lib/R/site-library brew

for installing brew but from my command line I get the following
error:

Warning: invalid package name ,and the other error was
Error: ERROR: no packages specified

I was able to run .R files like this:

<Location /R/plot2.R>
SetHandler r-handler
RFileHandler /var/www/R/plot2.R
</Location>

.R files are processed and I see the output via http://127.0.0.1/R/plot2.R
but plots don't work and I can not load any plotting libraries through
these .R files.

Also the following directive in .conf file or in sites-enable break
the apache and it stops working

<Directory /var/www/brew>
SetHandler r-script
RHandler brew::brew
DefaultType text/html
</Directory>

Thanks.

Regards,

Pics

unread,
Apr 22, 2011, 10:57:23 AM4/22/11
to rapache
I am having the same problems. I am running RedHat Linux Enterprise
version 5.
I am getting the same error message with R CMD INSTALL
It hangs when I have the line

RHandler brew::brew

in the config file but

RFileHandler /var/www/brew/brew.R::brew

works when I tried the brew test files such as brew-test-1.brew in the
browser (i.e. http://localhost/brew/brew-test-1.brew typed in as a URL
to the browser)


On Apr 21, 8:37 pm, RapacheLover <phd...@gmail.com> wrote:
> Thanks for your reply Jeff.
>
> I am using Rapache on Linux Ubuntu on a 32 bit hardware.
>
> I went through the 100 most recent posts and one of your posts states:
>
> R CMD INSTALL -l /usr/lib/R/site-library brew
>
> for installing brew but from my command line I get the following
> error:
>
> Warning: invalid package name  ,and the other error was
> Error: ERROR: no packages specified
>
> I was able to run .R files like this:
>
> <Location /R/plot2.R>
>        SetHandler r-handler
>        RFileHandler /var/www/R/plot2.R
> </Location>
>
> .R files are processed and I see the output viahttp://127.0.0.1/R/plot2.R
> > > Regards,- Hide quoted text -
>
> - Show quoted text -

Jeffrey Horner

unread,
Apr 22, 2011, 11:16:00 AM4/22/11
to rap...@googlegroups.com
Hmmm...

The best thing to do is go to the RApacheInfo page and see if brew is
indeed installed and available to R. Specifically look at the
"Attached Packages" section, the "Installed Packages" section, and
also look at ".libPaths()".

Also fire up R on the command line and type .libPaths() to see if it
differs from the RApacheInfo page. That seems to be a comon problem;
you install brew on the command line but it's not available to
rApache.

Jeff

> --
> You received this message because you are subscribed to the Google Groups "rapache" group.
> To post to this group, send email to rap...@googlegroups.com.
> To unsubscribe from this group, send email to rapache+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rapache?hl=en.
>
>

--
http://biostat.mc.vanderbilt.edu/JeffreyHorner

Patty Pickup

unread,
Apr 22, 2011, 12:19:51 PM4/22/11
to rap...@googlegroups.com
There is nothing called "brew" or containing the word "brew" in the
Installed Packages or the Attached Packages. Does that mean it is not
installed or not installed correctly?
I installed brew from the CRAN website and thought it was installed
correctly. So somehow I am not getting an error message or something on the
install.

In RApacheInfo, .libPaths() is just:
/usr/lib/R/library
/usr/share/R/library

In R (from the command line) .libPaths() gives
[1] "/usr/local/lib/R/library"

Brew seems to be working from R more than from RApache. How do I change the
libPaths for RApache?

Jeffrey Horner

unread,
Apr 22, 2011, 12:32:11 PM4/22/11
to rap...@googlegroups.com
So did you install R from source into /usr/local? It seems that you
might have two R's installed on your system. You might be able to find
them by using the which command-line program like so:

which -a R

It looks like you installed rApache with /usr/bin/R, but when you call
R from the command-line it's picking up /usr/local/bin/R.

?

Jeff

insan air

unread,
Aug 2, 2016, 3:36:54 PM8/2/16
to rapache, pa...@pickupconsulting.com
R
install.packages("brew")

when it ask you to select the source, select 124 (USA (WA)) , it works !
when i select 0 as the source, it didn't work, it didn't find the brew package for Rapache 3.1.1

select 124 (USA (WA)) instead, it works !
Reply all
Reply to author
Forward
0 new messages