This may be off-topic or unrelated to RVM, but it just cropped up
after I installed RVM so maybe you can help.
When I try to directly run ruby scripts with the following shebang:
#!/usr/bin/env ruby
I get this error:
env: ruby\r: No such file or directory
Now, ruby is on my path:
$ which ruby
/usr/bin/ruby
$ ruby --version
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
$ ls -al /usr/bin/ruby
lrwxr-xr-x 1 root wheel 76 Aug 7 2008 /usr/bin/ruby ->
../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
AND this works outside of a script shebang:
$ /usr/bin/env ruby --version
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
What's up? I don't understand enough about 'env' to debug this
problem - I thought it just looked on the path, but that doesn't seem
to be the case...
Thanks,
-- Chad
Sounds like you're trying to run a script that has DOS/Windows line
endings (\r\n) on a machine that doesn't (linux/unix/mac os)?
^ This looks very suspicious, that is a 'carriage return' character.
Perhaps check the line endings to ensure that they are unix style with
nothing extra?
I verified that if I add a dos style ^M to the end of the shebang I
indeed get:
env: ruby\r: No such file or directory
When I remove it and ensure unix line break it works fine.
~Wayne
I believe that Steven is correct here ;)
~Wayne