Forum: Ruby on Rails web_service_api works under WEBRick, but not cgi

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D53151d3fb2de557729740292239d270?d=identicon&s=25 Thomas Kwan (thomask)
on 2005-12-08 18:13
I have created the following controller

  app/controller/stock/service_controller.rb

In there, I have

  class Stock::ServiceController < ApplicationController
  ...
     web_service_api Stock::ServiceAPI
  ...

Then, I created

  app/apis/stock/service_api.rb

The content of service_api.rb is

  class Stock::ServiceAPI < ActionWebService::API::Base
      api_method :get, :expects => <parameters>
  end

If I accessed the server running in Webrick with the following
client code, it works

  server = XMLRPC::Client.new("localhost", "/stock/service/api", 3003)

But if I access the server running in the cgi mode with the following
client code, I got an error

  server = XMLRPC::Client.ne("<host>", "/<project>/stock/service/api",
80)

And the error was

  Processing Base#index (for <ip> at 2005-12-08 11:53:36) [GET]
  Parameters: {}
  MissingSourceFile (no such file to load -- service_api):
    /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__'
    /usr/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'

Anyone knows what is going on here?
This topic is locked and can not be replied to.