execute shell script from ruby on rails with passing variable

放肆的年华 提交于 2019-12-22 01:05:03

问题


Im trying to integrate prosody xmpp server with my rails application. I need to create some users in a database upon registration so I can lateron use them inside the prosody server.

What would be the best way to run shell commands in rails and output any info logs ?

prosodyctl adduser User.username

回答1:


i usually run with system(command),or with backtick command,other way you can refer here



来源:https://stackoverflow.com/questions/12299231/execute-shell-script-from-ruby-on-rails-with-passing-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!