I am trying to get my webrick serve in port 80. I tried:
rails server -p 80
but get a access denied. I later understood that using port 1-1024
It seems that the mysql2 gem is not installed in the ruby run time that is used. however as this works for you without sudo, i suspect that you have rvm installed and you are using the rvm ruby (which has mysql installed) by default when lunching rails without sudo. but when you do sudo you are most probably using the system ruby which doesn't have mysql2 installed.
so in short if you have rvm installed and is using that. just use:
rvmsudo rails server -p 80