Question

which ruby - /usr/local/bin/ruby

.bash_profile has the above path

I have not left any trailing spaces before #!/usr/bin/env ruby in the ruby script

When I try to run sh ruby_script, it gives require: command not found. It is not able to recognize any of the ruby commands.

I checked all the other posts getting the same error, and fixed everything accordingly. What else could I be missing?

Was it helpful?

Solution

Running sh ruby_script is wrong. You must run ruby ruby_script instead. If the file is executable run ./ruby_script.

OTHER TIPS

sh ruby_script is invoking the shell. Try either

/path/to/ruby_script

or

ruby /path/to/ruby_script
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top