ERROR: Could not find a valid gem 'rails' (>= 0), here is why: Unable to download data from

Well, this is probably more than you need, but it does include everything that you need to get a Rails development system on the Pi.

http://rabiedenharn.tumblr.com/post/35572989949/making-a-custom-raspberry-pi-image

-Rob