require: command not found

bash, ruby

Solution

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

Problem

`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?

Original source