From: Heesob Park Date: 2009-01-11T13:44:35+09:00 Subject: Re: Unique identify computer (both Windows and MacOSX) 2009/1/11 Matt Harrison : > Daniel Berger wrote: >> >> On Jan 10, 4:04 pm, Jarmo Pertman wrote: >>> >>> puts RUBY_PLATFORM >>> >>> Fernando Malard wrote: >>>> >>>> Hello, >>>> How can I unique identify the OS where my Ruby code is running? >>>> I can do this using specific Win32 features but I looking for an OS >>>> independent approach...maybe using the HD serial? >>>> Regards, >>>> Fernando. >> >> No, don't use RUBY_PLATFORM because it won't work with JRuby, and >> possibly other implementations. >> >> Instead, require "rbconfig", then check Config::CONFIG['host_os']. >> >> Regards, >> >> Dan >> > > I believe the OP wants to get a unique identifier for each host, something > like a GUID. I have no idea how you would make this cross platform though, > maybe IP address but those change, or HD serial, but again that's > changable... > > Windows supports GUIDs inherantly however AFAIK *nix systems don't. > > Sorry I don't have a solution. > > Matt > > If the OP wants the unique ID per computer in cross platform way, the mac address is one solution. Try ruby -r macaddr -e' p Mac.addr ' gem install macaddr Regards, Park Heesob