I am trying to integrate ActiveMerchant in my rails app. I have certain plans that if subscribed limit the user access. As you all guyz might be knowing what a subscription base
Active merchant supports recurring payments for some of its gateways ( https://github.com/Shopify/active_merchant/wiki/GatewayFeatureMatrix ).
Each has slightly different syntax ( https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/authorize_net_cim.rb) but can accomplish what you want.
I would recommend however you pick your payment gateway and use a specific APi for it. AM lags behind somewhat (from my experience) and recurring payments are not its primary goal.
There are also services out there that will handle all the gateway interaction for you and you just deal with there API. It makes it easier to accept payment and handle Pci DSS requirements in the case of 3rd party hosted payment pages.