I am building a Web App and a separate API (so that users can share their collected data with someone if they want to) using Ruby on Rails. The users can log in on the web a
If you to build json, xml based api, use rabl gem https://github.com/nesquena/rabl.
For simpler authentication, go for session based authentication which rails provided with session variable in controller. If you want neat, some function for user, then go for authologic gem https://github.com/binarylogic/authlogic.
If you want complete user management , then go for devise gem.