Ruby Gems in CGI not working

I’m having trouble with Ruby via CGI. I’m trying to use a gem in a ruby script called by http.cgi, but whenever I require a gem I get cgi: no headers. When I run on CLI it works fine. My guess is that the environment that CGI is using is different from the environment I’m using. I’ve replicated it as closely as possible - same pwd and user as the script as checked with ps, but no luck. Any ideas?

For those people landing here, this issue was resolved in caddy-cgi issues. The solution was to use the subdirective pass_env HOME.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.