【发布时间】:2015-08-30 15:39:48
【问题描述】:
我正在尝试使用 Sinatra 在 Chrome 中显示 ls 的结果。但是资源管理器进入了“正在连接...”循环。
我的代码是:
require 'rubygems' if RUBY_VERSION < "1.9"
require 'sinatra/base'
#This is the webservice to launch the gamma project
#Using Request at the principal webpage
class MyApp < Sinatra::Base
get '/' do
result = exec "ls"
puts result
end
end
我不确定puts,我认为这可能不是合适的方法。可能会发生什么,我该如何解决?
PS:在资源管理器中我使用了localhost.com:4567/
【问题讨论】:
标签: html ruby web-services sinatra