Posted by & filed under Ruby on Rails, Web Development.

Using typical Grunt deployment scripts works fine, except there is a trick to run a bundle update using the Gems installed via a single user RVM install:

'bundle-update': {
command: "[[ -s \"/home/username/.rvm/scripts/rvm\" ]] &&
source \"/home/username/.rvm/scripts/rvm\" &&
cd /path/to/project/ && bundle update"
}

This runs the RVM shell init commands saved to your shell’s configuration that are not loaded with commands such as those invoked by Grunt. If your Rails project is being served via NGinx, you can use this Grunt task to restart the web server on deployment.