rails4 fixes

Here are some fixes I needed to get this to work on rails4 without errors or deprecation warnings.  I couldn't find the beta8 branch/tag that rubygems was serving, so I also tossed in the changes between beta6 and beta8.  (Sorry if I missed these somehow)