'Need a less repetitve way to start Rails on Mac

I've been on a Mac just over a month and before that I've been using Windows and wrote a .bat file to run a few other little .bat files to fire up MongoDB, guard start for livereload, rails server, and a rails console. And it lastly launches e-texteditor which opens that rails dir as a project.

I hope this is the right place to ask and not superuser. So what is one way I can automate these things on Mac? -- Currently, I launch 1 terminal window with 4 tabs. tab 1 runs 'mongod', tab 2 runs 'rails s', tab 3 runs 'guard start', tab 4 runs 'rails c'. then I open one more tab and do 'mate .'



Solution 1:[1]

Foreman is your best friend.

Step 1: Install foreman

gem i foreman

Step 2: Create a file named Procfile

rails: rails server
mongo: mongod
guard: guard start

Step 3: Run foreman start. It will automatically start all 3 servers. If you press Ctrl-C, all servers will be terminated.

Step 4: Run rails c in another terminal.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 miaout17