I've set up my Apache installation to operate Ruby CGI scripts. I'm now attempting to operate a simple Ruby CGI script that needs a jewel.

After I run this script in the command line, it results properly. However when I refer to it as being an Apache CGI script, it creates an Apache Internal Server Error. The script appears like this:

#!/Ruby/bin/ruby

require 'RedCloth'  # <-- This is the gem

puts "Content-type: text/html"
puts 
puts
puts "<html>"
puts "<head>"
puts "</head>"
puts "<body>"
puts "I want to call a gem."
puts "</body>"
puts "</html>"

The Apache error log shows wrinkles:

C:/Ruby/lib/ruby/1.9.1/rubygems/config_file.rb:56:in `join': can't convert nil into String (TypeError)
[error] [client 127.0.0.1] \tfrom C:/Ruby/lib/ruby/1.9.1/rubygems/config_file.rb:56:in `<class:ConfigFile>'
[error] [client 127.0.0.1] \tfrom C:/Ruby/lib/ruby/1.9.1/rubygems/config_file.rb:28:in `<top (required)>'
[error] [client 127.0.0.1] \tfrom <internal:lib/rubygems/custom_require>:29:in `require'
[error] [client 127.0.0.1] \tfrom <internal:lib/rubygems/custom_require>:29:in `require'
[error] [client 127.0.0.1] \tfrom C:/Ruby/lib/ruby/1.9.1/rubygems.rb:1110:in `<top (required)>'
[error] [client 127.0.0.1] \tfrom <internal:lib/rubygems/custom_require>:29:in `require'
[error] [client 127.0.0.1] \tfrom <internal:lib/rubygems/custom_require>:29:in `require'
[error] [client 127.0.0.1] \tfrom <internal:gem_prelude>:167:in `load_full_rubygems_library'
[error] [client 127.0.0.1] \tfrom <internal:gem_prelude>:217:in `try_activate'
[error] [client 127.0.0.1] \tfrom <internal:lib/rubygems/custom_require>:32:in `rescue in require'
[error] [client 127.0.0.1] \tfrom <internal:lib/rubygems/custom_require>:29:in `require'
[error] [client 127.0.0.1] \tfrom C:/Apache/Apache2.2/cgi-bin/cgitest.rb:3:in `<main>'

After I don't range from the require 'RedCloth' line, Apache executes my cgi script all right.

Can there be someting apparent that I am missing here? Are you able to, actually, even perform Ruby CGI script that needs a jewel? Any experience could be greatly appreciated.

Thanks, Maurice

Perhaps you have do this ? require 'rubygems' require 'RedCloth' # <-- This is actually the jewel

most likely running as apache it does not have "read" use of some file or any other