小编the*_*ray的帖子

在 shell 脚本中使用 Rails runner 显示命令运行的输出

我正在编写一个可执行的 shell 脚本,该脚本使用rails runner 在rails 控制台中执行某些操作。如何查看 ruby​​ 命令的结果并将其打印到屏幕上。

我尝试使用 -v 来详细运行脚本,但我仍然无法看到发生了什么。

#!/bin/sh
sudo rails runner "Model.print_something"
Run Code Online (Sandbox Code Playgroud)

ruby shell ruby-on-rails sh

3
推荐指数
1
解决办法
2478
查看次数

标签 统计

ruby ×1

ruby-on-rails ×1

sh ×1

shell ×1