« Back to Index

AWS Lambda using Ruby (via uploaded compiled binary of MRI)

View original Gist on GitHub

lambda with ruby.js

console.log('Loading function');

var exec = require('child_process').exec,
    child;

exports.handler = function(event, context) {
    exec('/var/task/ruby/bin/ruby /var/task/foo.rb', function (error, stdout, stderr) {
        console.log('stderr:', stderr);
        console.log('stdout: ' + stdout);
        context.done(null, stdout);
    });
};