Arduino updates sqlite through ruby

Hello,

How can i make a simple random counter in arduino and store it in a sqlite database via ruby using serialport?

How can i make a simple random counter in arduino

This hardly makes sense. A counter implies that you are counting things. A random number implies games fo chance. What, exactly, do you want to do?

and store it in a sqlite database via ruby using serialport?

Serial.print(confusingRandomNumber);

What you do with it on the other end has nothing to do with Arduino.