문제

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?

도움이 되었습니까?

해결책

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

다른 팁

sh ruby_script is invoking the shell. Try either

/path/to/ruby_script

or

ruby /path/to/ruby_script
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top