rvm error wrapping thin

Posted by in Technical

Yesterday I play with rails apps to run with thin. The document that I follow said :

Edit /etc/init.d/thin on DAEMON line to :

DAEMON=/usr/local/rvm/bin/bootup_thin

But no bootup_thin on /usr/local/rvm/bin/. So, I move on setting up thin, it could run the app successfully when I ran thin manually like :

$ thin start -c /home/ec2-user/apps/current/ -p 3000 -e production

The app is running, CSS and Java Script not loaded yet but at least the app running. After reading several blogs I found that I need to wrap thin so that it could use correct rvm and ruby environment. But, again when I ran :

$ rvm wrapper 2.0.0-p353 bootup thin
No bin path suitable for lining wrapper. Try setting 'rvm_bin_path'

Try to add /usr/local/rvm/bin/ to system PATH, export rvm_bin_path variable manually but still no luck. Turned out that I need to add the user that run application to rvm group. It’s written somewhere in rvm manual but as usual I didn’t RTFM. What you need to do when you face the same error is add your user to rvm group.

# usermod -aG rvm <your username>

you should be able to wrap thin successfully

$ rvm wrapper 2.0.0-p353 bootup thin
Regenerating 2.0.0-p353 wrappers.

That’s it. Happy hacking!