Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Creating executable ruby script with RBenv as the interpretter #25

Closed
bradical opened this Issue Nov 10, 2012 · 2 comments

Comments

Projects
None yet
2 participants

I've got RBenv installed to ~/.rbenv. What would I put at top of Ruby script to make it executable by RBenv?

Tried:

#!~/.rbenv/shims/ruby

to no avail.

mislav commented Nov 11, 2012

This project can't offer you support for rbenv, as it was only extracted from rbenv but doesn't have anything else to do with rbenv.

That said, the shebang for your ruby scripts should be one of the following:

  • #!/usr/bin/env ruby: For most of your scripts. If rbenv is properly setup in your environment, you don't need to "teach" your executables to use rbenv explicitly. That's the whole point of rbenv.
  • #!/usr/bin/env ruby-local-exec: For executables inside a project that has a ".rbenv-version" file, and they absolutely must be executed with that exact version of ruby. Useful for production deployments.

Thanks, that's great.

@bradical bradical closed this Nov 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment