0

Hi I have installed FastRWeb, Rserve and gWidgetsWWW2 packages and followed the instructions. on the respective sites on my Linux (Ubuntu 10.04.3) with Apache web server.

I have loaded the test.R app and when I go to the URL

//localhost/cgi-bin/R/app?app=test as in the following github site

https://github.com/jverzani/gWidgetsWWW2/tree/master/inst/FastRWeb

I can see the app in my browsers. When I click on the "Click for a message" button nothing happens. I can inspect the element on my come browser and see that there is an error when executing the runHandler.R function. The error I see is:

Error in rawToChar(request$body) : object 'request' not found

When I look at the header I see POST is passing request, but R is not seeing it as an object?

Request URL:http://localhost/cgi-bin/R/gwappAJAX/runHandler
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:77
Content-Type:application/json
Host:localhost
Origin:http://localhost
Referer:http://localhost/cgi-bin/R/app?app=test
User-Agent:Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko)                     Chrome/myIP Safari/536.11
X-Requested-With:XMLHttpRequest
Request Payload
{"id":"ogWidget_ID3","signal":"click","value":null,"session_id":"0BJS1QKLM9"}
Response Headersview source
Connection:Keep-Alive
Content-Encoding:gzip
Content-Length:78
Content-Type:text/html; charset=utf-8
Date:Thu, 12 Jul 2012 17:17:50 GMT
Keep-Alive:timeout=15, max=96
Server:Apache/2.2.14 (Ubuntu)
Vary:Accept-Encoding

Did in miss something in the set up? why isn't my R session not seeing the request object?

1 Answers1

0

You are better off running such scripts under Rook, the FastRWeb setup is much less responsive. I've found running Rook on a local port, like 9000 and using apache to reverse proxy to that port will work fine, though it doesn't scale the way a FastRWeb solution should.

With that said, does it run locally under Rook through load_app? If so, then it may be that the newer FastRWeb + RServe isn't working. I haven't tested this since Simon updated his work. I hope to get to this though this summer. The promise of using websockets for the communication with R should bypass this responsiveness issue.

jverzani
  • 5,600
  • 2
  • 21
  • 17