0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

cgi_runnerエラー対処法

0
Posted at

WEBrickサーバを建てて、cgi使用したら下記エラーが発生しました。
Ruby/Webrick/CGI: cgi_runner.rb:47:in `exec': Permission denied ... (Errno::EACCES)

解決方法は下記のようになる

sample.rb
require 'webrick'
include WEBrick 

s = HTTPServer.new(
	:Port => 8000,
	:DocumentRoot => './',
	:CGIInterpreter => "C:/Ruby25/bin/ruby.exe" #これを追加する必要ある
)

s.mount('/Verify', WEBrick::HTTPServlet::CGIHandler, './verify.rb')
s.mount('/CreateModel', WEBrick::HTTPServlet::CGIHandler, './CreateModel.rb')

trap("INT") {s.shutdown}
s.start
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?