安装时出错。程序包(";ggiraph";):";对‘;的调用没有匹配函数;regex_replace";/AWS云Linux上的RStudio
我在尝试在R(基于linux的AWS实例上的RStudio服务器,新的RStudio和R版本)中安装ggiraph时遇到了这个错误 在任何地方都找不到linux系统的任何建议(仅适用于OS X) 有没有人遇到过同样的问题?你是如何解决的 谢谢大家! 错误消息:安装时出错。程序包(";ggiraph";):";对‘;的调用没有匹配函数;regex_replace";/AWS云Linux上的RStudio,r,linux,std,ggiraph,R,Linux,Std,Ggiraph,我在尝试在R(基于linux的AWS实例上的RStudio服务器,新的RStudio和R版本)中安装ggiraph时遇到了这个错误 在任何地方都找不到linux系统的任何建议(仅适用于OS X) 有没有人遇到过同样的问题?你是如何解决的 谢谢大家! 错误消息: dsvg.cpp: In function ‘std::string compile_css(const string&, const char*, const string&, const char*, const ch
dsvg.cpp: In function ‘std::string compile_css(const string&, const char*, const string&, const char*, const char*, const char*)’:
dsvg.cpp:725:46: error: no matching function for call to ‘regex_replace(const char*&, std::regex&, std::string&)’
return std::regex_replace(css, pattern, cls);
^
dsvg.cpp:725:46: note: candidates are:
In file included from /usr/include/c++/4.8.2/regex:62:0,
from dsvg.cpp:16:
/usr/include/c++/4.8.2/bits/regex.h:2162:5: note: template<class _Out_iter, class _Bi_iter, class _Rx_traits, class _Ch_type> _Out_iter std::regex_replace(_Out_iter, _Bi_iter, _Bi_iter, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type)
regex_replace(_Out_iter __out, _Bi_iter __first, _Bi_iter __last,
^
/usr/include/c++/4.8.2/bits/regex.h:2162:5: note: template argument deduction/substitution failed:
dsvg.cpp:725:46: note: deduced conflicting types for parameter ‘_Bi_iter’ (‘std::basic_regex<char>’ and ‘std::basic_string<char>’)
return std::regex_replace(css, pattern, cls);
^
In file included from /usr/include/c++/4.8.2/regex:62:0,
from dsvg.cpp:16:
/usr/include/c++/4.8.2/bits/regex.h:2182:5: note: template<class _Rx_traits, class _Ch_type> std::basic_string<_Ch_type> std::regex_replace(const std::basic_string<_Ch_type>&, const std::basic_regex<_Ch_type, _Rx_traits>&, const std::basic_string<_Ch_type>&, std::regex_constants::match_flag_type)
regex_replace(const basic_string<_Ch_type>& __s,
^
/usr/include/c++/4.8.2/bits/regex.h:2182:5: note: template argument deduction/substitution failed:
dsvg.cpp:725:46: note: mismatched types ‘const std::basic_string<_Ch_type>’ and ‘const char*’
return std::regex_replace(css, pattern, cls);
^
dsvg.cpp:726:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
...
^
make: *** [dsvg.o] Error 1
ERROR: compilation failed for package ‘ggiraph’
removing ‘/home/sandbox/R/x86_64-redhat-linux-gnu-library/3.6/ggiraph’
restoring previous ‘/home/sandbox/R/x86_64-redhat-linux-gnu-library/3.6/ggiraph’
Error: Failed to install 'ggiraph' from GitHub:
(converted from warning) installation of package ‘/tmp/RtmpU8zekV/file485f57d349a8/ggiraph_0.7.9.tar.gz’ had non-zero exit status
dsvg.cpp:std::string compile函数中的css(const string&,const char*,const string&,const char*,const char*,const char*):
dsvg.cpp:725:46:错误:调用“regex_replace(const char*&,std::regex&,std::string&)”没有匹配的函数
返回std::regex_replace(css、模式、cls);
^
dsvg.cpp:725:46:注:候选人为:
在/usr/include/c++/4.8.2/regex:62:0中包含的文件中,
来自dsvg.cpp:16:
/usr/include/c++/4.8.2/bits/regex.h:2162:5:注:模板(Out)iter std::regex(替换)((Out)iter、(Bi)iter、(Bi)iter、(Bi)iter、)Bi)iter、const std::basic(regex&)const std::basic)
正则表达式替换(\u Out\u iter\u Out,\u Bi\u iter\u首先,\u Bi\u iter\u最后,
^
/usr/include/c++/4.8.2/bits/regex.h:2162:5:注意:模板参数推导/替换失败:
dsvg.cpp:725:46:注意:参数“\u Bi\u iter”(“std::basic\u regex”和“std::basic\u string”)的推断冲突类型
返回std::regex_replace(css、模式、cls);
^
在/usr/include/c++/4.8.2/regex:62:0中包含的文件中,
来自dsvg.cpp:16:
/usr/include/c++/4.8.2/bits/regex.h:2182:5:注:模板std::basic_string std::regex_replace(常量std::basic_string&,常量std::basic_regex&,常量std::basic_string&,std::regex_常量::match_flag_type)
正则表达式替换(常量基本字符串和,
^
/usr/include/c++/4.8.2/bits/regex.h:2182:5:注意:模板参数推导/替换失败:
dsvg.cpp:725:46:注意:类型“const std::basic_string”和“const char*”不匹配
返回std::regex_replace(css、模式、cls);
^
dsvg.cpp:726:1:警告:控件到达非无效函数的末尾[-Wreturn类型]
}
^
...
^
make:**[dsvg.o]错误1
错误:包“ggiraph”的编译失败
删除“/home/sandbox/R/x86_64-redhat-linux-gnu-library/3.6/ggiraph”
恢复以前的“/home/sandbox/R/x86_64-redhat-linux-gnu-library/3.6/ggiraph”
错误:无法从GitHub安装“ggiraph”:
(从警告转换而来)包“/tmp/RtmpU8zekV/file485f57d349a8/ggiraph_0.7.9.tar.gz”的安装具有非零退出状态
对于这个问题,我的解决方案是更新linux GCC版本。
在终端上键入脚本以更新GCC
gcc -v ## to check your gcc version(original centos 7 seems 2.5.4)
并参考本文更新开发人员工具8
在CentOS上,安装CentOS存储库中提供的CentOS release scl软件包:
sudo yum install centos-release-scl
在RHEL上,为您的系统启用RHSCL存储库:
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
安装集合:
sudo yum install devtoolset-8
开始使用软件集合:
scl enable devtoolset-8 bash
检查您的GCC版本是否为最新版本:
gcc -v #### Now GCC version should be 8.3.1 20190311
进入R,在终端上安装ggiraph:
sudo R
安装ggiraph包:
install.packages('ggiraph', repos='http://cran.us.r-project.org')
退出终端R
q() # type "n" to not save workspace image
并切换到rstudio控制台,库ggiraph包
library(ggiraph)
所有ggiraph功能现在都可以工作了!:D