Ruby Command in Grunt

Hey Everyone,

I have a Ruby Gem installed that allows me to download a Shopify theme and a Grunt workflow I use to create and deploy. Is it possible to run that Ruby command automatically through gruntfile.js?

I normally download the entire theme from the command line, “theme download”. Then I open up my Grunt workflow. I’d like to do it all in one shot each time I start Grunt so I don’t forget to download and then accidentally upload my local files, overwriting the client’s site.

(I haven’t found a grunt plugin that allows me to download a Shopify theme, only upload).


Assuming Ruby is installed, you can always run ruby -e something.rb to execute a ruby file. Perhaps include that as a Grunt task.


Say you have two files:


var process = require('child_process');
process.exec('ruby hello.rb',function (err,stdout,stderr) {
  if (err) {
  } else {


puts "Hello"


$ node test.js
=> Hello

Play around with that and you should be able to do what you are attempting.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.