Process working correctly in foreground does not work on background
===

I have a job, a Ruby script that I have created but using a lot of libraries so is complex to trace. 
When I run it in a terminal like

ruby ./my_process

it works perfectly. 
But when I launch it as

ruby ./my_process & 

it stays in stopped status and it doesnt work as expected. 

I have tried to use daemonize_spawn gem, Process.daemon or even to use fork inside the ruby code with similar results, the process does not work correctly. 

Any idea of what can be happening?

I am using linux and ruby 1.9
