rvm gemdir #=> get current gemset
rvm alias create <app_name> <app_gemset>
# rvm alias create test ruby-2.1.2@test
Find the wrapper path
echo $rvm_path/wrappers/<app_name>
Then prepend the path to whatever command you want to run, e.g.
/home/deployer/.rvm/wrappers/test/ruby -v
sudo nano /etc/init.d/puma.sh
#!/bin/bash
su - "deployer" -c "cd /home/deployer/apps/<app_name>/current && /home/deployer/.rvm/wrappers/<app_name>/bundle exec pumactl start"
sudo chmod +x /etc/init.d/puma.sh
sudo update-rc.d puma.sh defaults
# sudo update-rc.d puma.sh start 30 2 3 4 5 . stop 21 0 1 6 .
If wrapper does not seem to work, consult the rvm documentation
If you mess up init.d startup script linking, the links can be reset using
sudo update-rc.d -f <script_file> remove
# sudo update-rc.d -f puma.sh remove
More at update.rb man pages