2014-04-19 63 views
0

嗨,我是在Windows中使用RJSONIO,當我執行以下正常工作:RJSONIO在Linux環境下的錯誤了以https

library(RJSONIO)  
fromJSON("https://issues.apache.org/jira/rest/api/2/project") 

它返回一個JSON但是當我做同樣的事情在我的Linux出現以下錯誤:

Error in file(con, "r") : cannot open the connection 

在谷歌做一些搜索後,我發現我需要提「文件=」 fromJSON(文件=「https://issues.apache.org/jira/rest/api/ 2/project「)

所以現在我得到的錯誤:

unable to find an inherited method for function âfromJSONâ for signature â"missing", "missing"â 

任何建議?

+0

你在兩臺機器上使用的是什麼版本?你可以通過'installed.packages()[「RJSONIO」,「Version」]來找到。 – flodel

回答

2

這在?urlhttp://中有解釋。URLs的工作方式與所有文件完全相同, 但是https://網址沒有。

Note that the https:// URL scheme is not supported except on Windows. There it is only supported if --internet2 or setInternet2(TRUE) was used (to make use of Internet Explorer internals), and then only if the certificate is considered to be valid. With that option only, the http://user:[email protected] notation for sites requiring authentication is also accepted.

可以明確地使用RCurl

fromJSON(RCurl::getURL("https://issues.apache.org/jira/rest/api/2/project"))