Run a ruby script automatically after modification

219 Views Asked by At

When I develop in node.js, I like to use node-supervisor because when I save a file, it reloads automatically, which eliminates the need of having to kill and restart the service every time.

Is there something similar for ruby? Hopefully something easy to install like a gemfile?

3

There are 3 best solutions below

0
On

Perhaps something like Guard may help.

0
On

For Rails server or other Ruby things, you can use Pow

0
On

In this very basic scenario (assuming you have node and npm installed). You can initialize npm via npm init and install nodemon via npm i --save nodemon. Then just, run npx nodemon --exec "ruby" <path-to-file>/<file-name>.rb. Hope it help someone to start with!