When you run shell commands using the tick marks, they will be run in a child process that can not change the working directory of the parent.
If you link the cd
command with another command, you will see it work, but only effecting the child process:
`cd / && ls`
To change the working directory of the parent process use the Ruby command Dir.chdir([string])
:
Dir.chdir("/")
Relevant information can be found in this post: "exec the cd command in a ruby script"