Rails unicorn start on boot error

Hello,guys. I have a problem with unicorn start on boot (OS is gentoo). I write in /etc/local.d/local.start file:     #!bin/sh     /etc/init.d/unicorn start

and when I reboot computer it can't start my rails application and in unicorn.stderr.log writes 'require cannot load such file -- bundler/setup (LoadError)'. But when I write in shell "/etc/init.d/unicorn start" everything is ok. My app is running. Can someone help me?

Environment 1: running a script as user 'root' at boot time Environment 2: running a script as you in a login shell

One of these things is not like the other :slight_smile:

Environment 1: running a script as user 'root' at boot time Environment 2: running a script as you in a login shell

One of these things is not like the other :slight_smile:

Thanks, I undestood. And what should I do? I can't run script as other user when boot?

Thanks, I undestood. And what should I do? I can't run script as other user when boot?

I've already solve my problem. I wrote 'su -l user -c command' in my local.start file, and everything is ok.