Actually, I modified CyanogenMod to create empty "/bin, /lib, /usr, /var, /svr, /home, /media, etc, etc" and then modified "${source_root}/system/core/include/private/android_filesystem_config.h" to include rules for the directories and then modified my external sdcard so it wouldn't mount as fuse or with the sticky bit set (it would set root:sdcard_rw ownership to all file inside) and after start up I ran a script that mounted the Linux arm root directories on the external sdcard to the empty versions in Android's root. The embedded version of glibc was used with a Kali Linux armhf chroot image I created, but it didn't have ruby or metasploit. So I followed some directions about compiling ruby 1.9.3 with svn or something and then used that to install metasploit, the only thing was that postgresql didn't work because socket and file creation are very permission sensitive and sockets may have been involved, so no postgres database, have yet to try to connect to a db on another host though. Apache2 worked, I did the whole /etc/init.d/apache2 start and viola, "It Works!" you know that if you've seen it.
So in short, yes, you can compile ruby and many more programs on Android, glibc just has to be available, ie /lib directory and contents on Linux.
And as a side note, I used a Galaxy S III Sprint with 2GB of RAM. Python works great, I just started experimenting with Unix sockets with python, they connected in /sdcard but I need to learn more about Android's security policies on sockets and database creation before I move any further with getting metasploit and working with a database working on Android + glibc.