Save the Ruby script in ~/.bin/note_to_self.rb. Configure it, install the gems it uses.
Add an Alfred extension manually as described below.
Use the "Keyword to Script to Notification" template; use the below as your script.
Keyword: note | [x] with space | Argument Required
Keyword: note
Options: [x] Silent
Command:
source ~/.rvm/scripts/rvm
~/.bin/note_to_self.rb {query}
Parameter: Required parameter
Advanced: Output: Output to Notification Center