Get rid of rails specific stuff

Should've tested this independently, rather than in a Rails project! Got a bit of fail when using it independently. This should fix it.