Rails is just a structure written in ruby, so basically you should be able to use any library, class or module that you want. However, not everything does as graphical interfaces, etc.
The Ruby implementation and the platform you are working on may also have limitations, for example, everything may not work on a Windows server or on MacRuby or JRuby, etc.
source share