Last Updated: February 25, 2016
·
1.101K
· sheerun

Meet ruby-local-exec

ruby-local-exec is a drop-in replacement for the standard Ruby
shebang line:

#!/usr/bin/env ruby-local-exec

Use it for scripts inside a project with an .rbenv-version
file. When you run the scripts, they'll use the project-specified
Ruby version, regardless of what directory they're run from. Useful
for e.g. running project tasks in cron scripts without needing to
cd into the project first.

2 Responses
Add your response

Just for the sake of not confusing users who bump into this protip, ruby-local-exec has been deprecated in rbenv 4.0. More info here: https://github.com/sstephenson/rbenv/wiki/ruby-local-exec

over 1 year ago ·

@cassianoleal Thank you. I think I'll just remove this protip.

over 1 year ago ·