I don't think you need to use brew for what you're trying to accomplish. The command you posted, \curl -sSL https://get.rvm.io | bash -s stable --rails
makes use of railsinstaller, as noted on the rvm website.
If you look on the railsinstaller website, it currently says "Please do not run the installer on OSX Mavericks until further notice."
As CWitty mentioned, your best bet is probably to install rubygems and rails separately.
First install the stable version of RVM stable with ruby:
\curl -sSL https://get.rvm.io | bash -s stable --ruby
Then update rubygems:
$ gem update --system # may need to be administrator or root
And finally install rails using rubygems:
gem install rails