sudo: gem: command not found

If you installed Ruby via RVM (you should of) you need to use the
`rvmsudo` command. Ergo:

    sudo gem install rails --include-dependencies

Becomes:

    rvmsudo gem install rails --include-dependencies

Bryan Dunsmore wrote in post #1038409:

If you installed Ruby via RVM (you should of) you need to use the
`rvmsudo` command. Ergo:

    sudo gem install rails --include-dependencies

Becomes:

    rvmsudo gem install rails --include-dependencies

rvmsudo worked for me. Thanks.