Fixed rpc method detection code

Old code used `try` method which doesn't exist if you don't use
ActiveSupport.