ERROR: configuration failed for package 'RCurl'
locate libcurl
and see
if it returns something like libcurl.so in the lines it
emits. Alternatively, do
locate curl-config
and see if it is present.
If libcurl is not installed, use your binary package manager
to install the curl-dev package. This is different from
the curl package which is the command-line tool
for using curl to download files. We need the "linkable" library.
CURLOPT_HTTPAUTH
not being defined when the C code is being compiled.
What's the problem?
url.c: In function `RCurlVersionInfoToR': curl.c:613: structure has no member named `libidn' curl.c:613: structure has no member named `libidn'
http://www.omegahat.org/RCurlto
http://www.omegahat.org/RCurl/That works for me.
curl-config --featureIf ssl doesn't appear there, you don't have support for it. You should reinstall curl, having first installed SSL (e.g. openssl).
httpauth = 1L, # "basic"
to the curl options.
But there is a general approach to trying to figure out how
to get R to do the same thing as a browser or curl
or wget.
One approach is to make certain that both R
and curl are giving us as much information as possible.
So make sure both have verbose switched on.
In R, this is a curl option verbose = TRUE
and for curl, is is the command line switch -v.
Then look at the header information both produce and see if
anything is obviously missing or different in the R version.
A different idea is somewhat advanced, but not very. When the browser or curl makes a request, it is sent across the network via your operating system. With the appropriate permissions on the computer, we can use a program such as tcpdump or wireshark or ethereal to "sniff" or capture the packets as they go across the network device and then we can look at them. We can do this for the curl or browser and then for R and compare what is being sent. This allows us to see the headers as we can with the verbose options, but it also allows us to see the content of the body of the request. This is only important for POST requests.
We should also note that if you are using HTTPS, the body will be encrypted and you won't be able to make any sense of it. However, if the data in the post are not sensitive, you can send it via HTTP - not HTTPS - and curl and the Web browser will do the same thing and we will be able to see the contents. The server will likely be confused and upset and give an error, but we are trying to determine the problem on the initial client request so that is not a problem. (It is a problem if we are trying to understand why R is not handling the response correctly, but that's a different problem.)
How do we use tcpdump and ethereal? First, start tcpdump just before you run the R or curl command
sudo /usr/sbin/tcpdump -s 1518 -i eth1 -w r_packets.tcpIf you do this and wait too long, you will capture all the background packets that are flying through your network interface that have nothing to do with your problem. This is not a problem, but it makes it harder to find the packets which we want to examine.
So next, go back to R or curl and run the command. When this has completed, kill the tcpdump process, e.g Ctrl-C in the terminal in which it is running or kill with the relevant process id (see the ps command or the Mac activity monoitor.) Now run ethereal with the name of the file to which tcpdump serialized the packets
ethereal r_packets.tcpAnd then you will get a window that looks something like