I have an ubuntu server, with a rails application. When I access directly that server, I have no problem with the setting of the path for my rails commands, but when I log trough ssh for my iMac, I got differents setting, so, for example, the

wich rails



but from ubuntu return


who is the correct one.

Anyone knows how to set correctly those values for ssh?

Thanks in advance

1 Answer 1


SSH is not the problem, and does not need to be further configured, what you're seeing is symptomatic of not having the path correctly setup. Try this: echo $PATH both at local machine and using ssh.

When you installed rails by hand, where did you extend the path to include /usr/local/bin ? You need to make sure your terminal is sourcing that file, which it obviously is not.

EDIT: There are many places where you can add things the path, that is why I was asking you where did you added it, in .profile? Knowing that it would be easy to fix. I would personally do it in .bashrc:

export PATH=$PATH:/usr/local/bin

just realize that this only makes sense if bash is your terminal.

  • effectively, the PATH are differents, how can I make sure that my terminal is sourcing that file correctly?
    – Nisanio
    Aug 5, 2012 at 22:41
  • @Nisanio: I've edited my answer a little bit.
    – carlosdc
    Aug 5, 2012 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.