[英]How To get hardware information using Ruby in Rails?
我正在尝试获取服务器的硬件信息并将其保存到数据库,该怎么办?
I believe it depends on your system, but looks like there is a gem called hardware_information . 我相信这取决于您的系统,但是看起来好像有一个名为hardware_information的宝石。 Maybe it's what you're looking for.
也许这就是您要寻找的。
If your server is running Linux, your code can just read files in /proc to get hardware information. 如果您的服务器运行的是Linux,则您的代码只需读取/ proc中的文件即可获取硬件信息。 For example:
例如:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.