how to get mac address, gem uuidtools 1.0.2 not working
-------------------------------------------------------

                 Key: JRUBY-1857
                 URL: http://jira.codehaus.org/browse/JRUBY-1857
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.1
         Environment: MacOS X 10.4.11, JRuby trunk r5456, Java 1.5.0_13
            Reporter: Stephen Bannasch
            Assignee: Thomas E Enebo
             Fix For: JRuby 1.1


The gen uuidtools produces uuids of various types and one of the inputs is the 
local computer's MAC address.

Using this gem produces an error

{code}
irb(main):001:0> require 'uuidtools'
=> true
irb(main):002:0> UUID.timestamp_create().to_s
ifconfig: interface 2>&1 does not exist
usage: ifconfig [-L] interface address_family [address [dest_address]]
                [parameters]
       ifconfig interface create
       ifconfig -a [-L] [-d] [-m] [-u] [address_family]
       ifconfig -l [-d] [-u] [address_family]
       ifconfig [-L] [-d] [-m] [-u]
ifconfig: interface | does not exist
StandardError: MAC address could not be autodetected.  Set the MAC address 
manually.
        from 
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/uuidtools-1.0.2/lib/uuidtools.rb:238:in
 `timestamp_create'
        from 
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/uuidtools-1.0.2/lib/uuidtools.rb:226:in
 `synchronize'
        from 
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/uuidtools-1.0.2/lib/uuidtools.rb:226:in
 `timestamp_create'
        from 
/Users/stephen/dev/jruby_trunk/jruby/lib/ruby/gems/1.8/gems/uuidtools-1.0.2/lib/uuidtools.rb:226:in
 `signal_status'
irb(main):003:0> RUBY_PLATFORM
=> "java"
{code}

The gem itself uses a platform-dependent call to ifconfig to determine the MAC 
address. Currently the gem does not check for:

{code}
RUBY_PLATFORM == "java"
{code}

What mechanism can be used from JRuby to get the MAC address?

UUIDTools home page: http://sporkmonger.com/projects/uuidtools

See [JRUBY-1676] and [JRUBY-1557] for descriptions of problems passing 
parameters to shell commands like ifconfig.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to