调试+运行

在controller里加入binding.pry, then turn to the server terminal

rails runner script/aaa.rb

原文地址:https://www.cnblogs.com/iwangzheng/p/3791641.html