Jason Swett
Jason Swett

Reputation: 45084

Only one certain user can run Ruby scripts

Whenever I try to run a Ruby script as any user but myself, I get this error:

/usr/bin/env: ruby: No such file or directory

I don't understand why this should be the case. When I installed Ruby, why would it think I only want it for one user?

Here's this if it helps:

$ which ruby
/home/jason/.rvm/rubies/ruby-1.9.2-p136/bin/ruby

Upvotes: 0

Views: 369

Answers (3)

Dylan Markow
Dylan Markow

Reputation: 124419

RVM defaults to only install for your own user account. However, it looks like they provide instructions for a system-wide installation which will allow access to all users. (However, each user will still need the RVM-specific updates in their shell profiles).

http://rvm.beginrescueend.com/deployment/system-wide/

Upvotes: 3

Morton Fox
Morton Fox

Reputation: 186

I think the other users could be missing /home/jason/.rvm/rubies/ruby-1.9.2-p136/bin in their PATH environment variable, so /usr/bin/env can't find ruby. Check their PATH and see if that is the case.

Upvotes: 0

Jason Swett
Jason Swett

Reputation: 45084

Maybe someone else will have a better answer but here's something I came up with:

The first line of my script was this:

#!/usr/bin/env ruby

I changed it to this and now other users can run the script:

#!/usr/bin/env /home/jason/.rvm/rubies/ruby-1.9.2-p136/bin/ruby

Upvotes: 0

Related Questions