How can I reference a local ruby ​​in a hash-bang executable?

I have a Ruby executable (this is a binstub bundler) that starts with

#!/usr/bin/env ruby

On my server, I have Ruby 193 installed through RVM.

$ which ruby
-> /home/dtuite/.rvm/rubies/ruby-1.9.3-p0/bin/ruby

On my local machine, I also installed Ruby via RVM, but in a different place (obviously!)

$ which ruby
-> /Users/davidtuite/.rvm/rubies/ruby-1.9.3-p0/bin/ruby

When I try to run this executable on the server, I get an error message

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

Is there a way I can reference a locally accessible ruby ​​in a hash so that the same script runs both on the server and on the local computer?

+5
source share
1 answer

Try it rvm-auto-ruby- this is explained in a slightly different context in the RVM Textmate Documentation .

+3

All Articles