I think building an application like that from scratch would be much easier trust me! The reason why I dont suggest building from CMS or any other gem is because you need to learn how it works which might be easier but integrating it into your application is tough and it gets tougher especially when the versions are different. I built wiki for one of the social networking website that I was building. It is simple. I built it just like I built a blog. Each blog has a post and an Author just like wiki has a user and a question asked by the user.
Blog has comments and wiki has answer to the question. Every other minor details follow along. I am still in the process of building a robust wiki with these basics. So I will be happy to help with any more questions that follow along.
The video that helped me with this process is:
http://media.rubyonrails.org/video/rails_blog_2.mov
Feel free to ask any more doubts that follow. I will be happy to share the code that I built.