From the Rails app I need to provision, configure and manage servers on Amazon AWS. Some time ago I've been using chef-solo and knife to do that, but from the command line. Would that be possible to do the same from inside the code? Any pointers on how to start?
I would suggest taking a look at chef-zero, it supersedes chef-solo as the way forward for running Chef without a central Chef Serer. It also has the advantage of having a Ruby API so you don't have to shell out.
From the description:
Chef Zero is a simple, easy-install, in-memory Chef server that can be useful for Chef Client testing and chef-solo-like tasks that require a full Chef Server.