运行存储在互联网上的 Ruby 脚本 [英] Run Ruby script that is stored on internet

查看:48
本文介绍了运行存储在互联网上的 Ruby 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的主机和域,用于上传我的 Ruby 脚本.我正在使用以下命令运行本地脚本:ruby path/to/script/script.rb.我上传了我的 Ruby 脚本,我想像这样在我的终端中运行它: ruby http://www.example.com/script.rb 但它不起作用.我该如何正确执行此操作?我可以用 curl+ruby 做吗?

I have my hosting and domain where I uploaded my Ruby script. I was running local scripts using this command: ruby path/to/script/script.rb. I uploaded my Ruby script and I want to run it in my terminal like this: ruby http://www.example.com/script.rb but it doesn't work. How do I do this properly? Can I do it with curl+ruby?

请注意,这不是网站、网络应用程序或任何此类内容.它只是一个 Ruby 脚本,可以在终端中打开并执行一些操作.

Please note that this is not website, web app or anything such. It's just a Ruby script that can be opened in terminal and do some stuff.

推荐答案

要运行网站上的 ruby​​ 程序,您可以尝试:

To run the ruby program located on website, you can try:

curl -s http://wwww.example.com/script.rb | ruby

-s curl 选项用于静默模式,因此 curl 命令没有额外的输出.

-s option to curl is for silent mode so that there is no additional output from curl command.

这篇关于运行存储在互联网上的 Ruby 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆