OpenResty中遇到"Can't locate Time/HiRes.pm in @INC"问题的解决方法

今天在研究resty这个命令行工具时,执行

resty -h

出现下面的报错

OpenResty中遇到"Can't locate Time/HiRes.pm in @INC"问题的解决方法

Can't locate Time/HiRes.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /opt/openresty/bin/resty line 20.
BEGIN failed--compilation aborted at /opt/openresty/bin/resty line 20.
打开脚本出错位置,看到
OpenResty中遇到"Can't locate Time/HiRes.pm in @INC"问题的解决方法

解决方法:

yum -y install perl-Time-HiRes

OpenResty中遇到"Can't locate Time/HiRes.pm in @INC"问题的解决方法


再次执行

resty -h

就一切正常了

OpenResty中遇到"Can't locate Time/HiRes.pm in @INC"问题的解决方法