문제

I'm trying to find a way to generate a unique system ID (HWID) without having to add any other gems first.

In other words, I want someone who's running a brand new version of Mac/Linux to be able to generate an ID, without having to install anything else.

The only ID methods I've found require additional gems to be installed, so that wont work.

도움이 되었습니까?

해결책

To follow Catnapper's comment, uuidgen is available on Linux systems, including Darwin.

Just make a call to it in your Ruby script:

irb(main):001:0> `uuidgen`
=> "613C66FE-F609-4389-8A70-A59D245070AE\n"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top