execute shell script from ruby on rails with passi

2019-04-17 10:12发布

问题:

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