# UUIDTool and weird timestamp split error

**URL:** <https://www.ruby-forum.com/t/uuidtool-and-weird-timestamp-split-error/71771>\
**Category:** Rails\
**Created:** [February 22, 2006, 10:34am UTC](https://www.ruby-forum.com/t/uuidtool-and-weird-timestamp-split-error/71771 "2006-02-22T10:34:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 22, 2006, 10:34am UTC](https://www.ruby-forum.com/t/uuidtool-and-weird-timestamp-split-error/71771/1 "2006-02-22T10:34:09Z")

</div>

Hi,

I am using UUIDTools to generate my Guids. It works fine on my computer  
(Windows Xp), but doesn’t work on my host (TextDrive)

The error is:

Loading production environment.

> > UUID.timestamp\_create.to\_s  
> > /sbin/ifconfig: Permission denied  
> > NoMethodError: private method `split' called for nil:NilClass from ./script/../config/../config/../lib/uuidtools.rb:236:in`timestamp\_create’  
> > from ./script/…/config/…/config/…/lib/uuidtools.rb:226:in  
> > `synchronize' from ./script/../config/../config/../lib/uuidtools.rb:226:in`timestamp\_create’  
> > from (irb):8
> 
> >

Any ideas what this could be? I am using ver 1.0 of UUIDtools.

Any help would be a life saver  
Joerg

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 22, 2006, 11:57am UTC](https://www.ruby-forum.com/t/uuidtool-and-weird-timestamp-split-error/71771/2 "2006-02-22T11:57:19Z")

</div>

Hi-

I’m completely new to rails - and ruby for that matter - but your  
problem seems to be that UUIDTools try getting the MAC Address of  
your network card by calling the program /sbin/ifconfig , which the user  
rails runs under cannot execute.  
Some soultions:

- Convince your provider to give oyur rails user execute permission on  
/sbin/ifconfig
- install ifconfig for your rails user (you might also have to convince  
the UUID code to use your local copy of ifconfig instad)
- convince the maintainer of the UUIDTools to implement another way to  
retrieve the MAC address
- overwrite UUID.get\_mac\_address to return teh mac adress from a config  
file instead of actually getting it from the network card

HTH,  
-markus

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 22, 2006, 12:04pm UTC](https://www.ruby-forum.com/t/uuidtool-and-weird-timestamp-split-error/71771/3 "2006-02-22T12:04:43Z")

</div>

Cool. Just found another way … you can use UUID.random\_create to get a  
Guid … doesn’t use the MAC address.

Markus Strickler wrote:

> Hi-
> 
> I’m completely new to rails - and ruby for that matter - but your  
> problem seems to be that UUIDTools try getting the MAC Address of  
> your network card by calling the program /sbin/ifconfig , which the user  
> rails runs under cannot execute.  
> Some soultions:
> 
> - Convince your provider to give oyur rails user execute permission on  
> /sbin/ifconfig
> - install ifconfig for your rails user (you might also have to convince  
> the UUID code to use your local copy of ifconfig instad)
> - convince the maintainer of the UUIDTools to implement another way to  
> retrieve the MAC address
> - overwrite UUID.get\_mac\_address to return teh mac adress from a config  
> file instead of actually getting it from the network card
> 
> HTH,  
> -markus

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 23, 2006, 12:31am UTC](https://www.ruby-forum.com/t/uuidtool-and-weird-timestamp-split-error/71771/4 "2006-02-23T00:31:36Z")

</div>

Joerg D. wrote:

> Cool. Just found another way … you can use UUID.random\_create to get a  
> Guid … doesn’t use the MAC address.

Doesn’t that defeat the purpose? I thought the only way you could  
guarantee  
that an ID was truly unique was to include another unique ID, e.g. the  
MAC  
address, CPU ID, or some other hardware serial number.

A random ID, even combined with date/time, could still theoretically  
collide  
(e.g. if two machines happened to pick the same random value at the same  
time).

– Steve

---

<div class="post-metadata">

**Author:** ![joergd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@joergd](https://www.ruby-forum.com/u/joergd)\
**Post date:** [February 23, 2006, 9:24pm UTC](https://www.ruby-forum.com/t/uuidtool-and-weird-timestamp-split-error/71771/5 "2006-02-23T21:24:14Z")

</div>

Steve S. wrote:

> A random ID, even combined with date/time, could still theoretically  
> collide (e.g. if two machines happened to pick the same random value  
> at the same time).

To have a ~50% chance of a collision, you must generate ~2^64 random  
128-bit numbers. Considering the small subset of those 2^64 that will  
actually be generated, the chance of duplicates happening randomly can  
be ignored — and its far less than the chance of either bugs in the  
implementation or even duplicate MAC addresses accidentally being  
assigned.
