I assume you are on Linux, if not, your installation of Rubygems somehow tries to install a gem for the wrong platform :)
Do you have the prerequisites listed here? ->
http://code.google.com/p/gosu/wiki/GettingStartedOnLinuxI'm not sure if there is a reasonable way to integrate their installation in the gem build process.