lb3ona
Last Updated: February 25, 2016
·
788
· sheerun
Photo on 08.01.2013 at 04.15

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.

Say Thanks
Respond

2 Responses
Add your response

6486

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 ·
6487
Photo on 08.01.2013 at 04.15

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

over 1 year ago ·