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.
Written by Adam Stankiewicz
Related protips
2 Responses
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#