Apparently, It was failing because of the friendlyId gem. If you use friendlyId, you may need to specify the rails4-branch.
gem 'friendly_id', github: 'FriendlyId/friendly_id', branch: 'rails4'
edit: Make sure to get the actual branch/version from norman/friendly_id. According to the readme, it needs to be at least branch: 5.0.0-beta
to work with rails4.
edit2: now it is 5.0.0.rc2
, as I said, make sure to get the actual branch/version, I won't obviously update this answer every time there is a version update. Also, read the comments to this answer, there are plenty of helpful information.