Hi,
I'm trying to get win32-service to work on Rails.
When I open up a console and do the following it works:
require "win32/service"
include Win32
@services = Service.services
puts @services.first
=> => #<struct Struct::Win32Service service_name="Abiosdsk", display_name="Abiosdsk",
service_type="kernel driver", current
_state="stopped", controls_accepted=nil, win32_exit_code=1077, service_specific_exit_code=0, check_point=0,
wait_hint=0,
binary_path_name=nil, start_type="disabled", error_control="ignore", load_order_group="Primary
disk", tag_id=3, start_n
ame=nil, dependencies=nil, description=nil, :interactive?=false, pid=0, service_flags=0>
If I do the same inside a Rails controller like this it dies:
gem "win32-service"
include Win32
class ServicesController < ApplicationController
def index
list
render :action => "list"
end
def list
# Enumerate over all services, inspecting each struct
@services = Service.services
end
end
The Error Message is as follows:
NoMethodError in ServicesController#list
undefined method `services' for Service:Module
I tried to use gem "win32/service" but it is no better. Google didn't help me either.
Any Suggestions?
Thanks in Advance,
Roberto |