thedayisntgray
thedayisntgray

Reputation: 113

Show output of command run using rails runner in shell script

I'm writing an executable shell script that does something in the rails console using rails runner. How do I see the results of the ruby command made and print them to the screen.

I tried running the script with -v for verbose but I still wasn't able to see what occurred.

#!/bin/sh
sudo rails runner "Model.print_something"

Upvotes: 3

Views: 2684

Answers (1)

Ahmed Kamal
Ahmed Kamal

Reputation: 645

Use puts
sudo rails runner "puts Model.print_something"

Upvotes: 6

Related Questions