Trying to set up the post-commit hook of Subversion in combination with certain Ruby version (gems and so on) controlled by RVM, I’ve ended up with this file (post-commit):
#!/bin/bash # Load RVM . /home/user/.rvm/scripts/rvm # Execute script previous rvm use whatever-ruby-version-you-have && /path/to/your/script.rb 1>/dev/null
Pay attention to the shebang (bash instead of sh), and the way of loading RVM (. /home/user/.rvm/scripts/rvm). This way RVM command can be invoked as usual 🙂