noreply at rubyforge.org
2008-Jul-07 20:51 UTC
[Win32utils-devel] [ win32utils-Support Requests-11344 ] Can''t user win32-service inside of a Rails application
Support Requests item #11344, was opened at 2007-06-04 03:21 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=412&aid=11344&group_id=85 Category: win32-service Group: None Status: Open Resolution: None Priority: 3 Submitted By: Roberto V. A. (robo) Assigned to: Nobody (None) Summary: Can''t user win32-service inside of a Rails application Initial Comment: 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 ---------------------------------------------------------------------->Comment By: Daniel Berger (djberg96)Date: 2008-07-07 13:51 Message: Any luck with this? Dan ---------------------------------------------------------------------- Comment By: Daniel Berger (djberg96) Date: 2008-02-21 18:38 Message: Namespace issue perhaps? Don''t include Win32 and try Win32::Service.services explicitly. Does that help? Regards, Dan ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=412&aid=11344&group_id=85