【问题标题】:execute shell script from ruby on rails with passing variable使用传递变量从 ruby​​ on rails 执行 shell 脚本
【发布时间】:2012-09-06 11:37:57
【问题描述】:

我正在尝试将 prosody xmpp 服务器与我的 rails 应用程序集成。我需要在注册时在数据库中创建一些用户,以便稍后在韵律服务器中使用它们。

在 rails 中运行 shell 命令并输出任何信息日志的最佳方式是什么?

prosodyctl adduser User.username

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 shell shell-exec


    【解决方案1】:

    我通常用system(command)运行,或者用反引号command,其他方式你可以参考here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-04
      • 1970-01-01
      • 2013-09-15
      • 2013-07-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多