kill process by name

ps aux | grep 'rails'| grep -v 'grep'| awk '{ print $2 }'| xargs kill -9