出现rails: command not found一般是由于path的原因。如下操作:
vim /etc/profile
加入
vim /etc/profile
加入
RAILS_PATH=/var/lib/gems/1.8/bin
PATH=$PATH:$RAILS_PATH
export PATH