Cron job failed to execute gem

I have scedule a cron job using crontab and launchd.

We are able to run the job via terminal but when any job is scheduled like via cron or launchd its not able to execute the gem installed at root level and child scripts has execute gem