Joined May 2011
·

Mislav Marohnić

GitHub
·
Zagreb, Croatia
·
·
·

Posted to `rbenv shell` and fish over 1 year ago

rbenv master now supports fish:

$ rbenv init fish
# Load rbenv automatically by adding
# the following to ~/.config/fish/config.fish:

. (rbenv init -|psub)

rbenv always enters the shims before all other PATHs

Aha, now I finally understand what you're struggling with. rbenv does add the shims to the front of PATH, but it does so only at the point where you call rbenv init in your .bash_profile:

eval "$(rbenv init -)"

If you edit your PATH after this point, you will be able to add paths in the front:

export PATH=./bin:"$PATH"

You want the local executables (bin/rake) to have precedence over global ones, including rbenv's shims. That means you want ./bin at the very front of your PATH.

Whenever you're thinking how to order things in your PATH, it helps to think about your priorities. Ask yourself, what do you want to happen when you type rake:

  1. You want the local binstub (bin/rake) to get activated if it exists, as it guarantees that the correct rake version will be activated;
  2. If a local binstub doesn't exist, you want rbenv's shim to get activated, as it guarantees that it will get executed with the correct version of Ruby for this project;
  3. Then, for non-Ruby commands, you want /usr/local/bin to be searched because that's where Homebrew lives (if you use it), or other software that you install manually;
  4. Finally, you want system paths such as /usr/bin to get searched.

Considering the above, it means your PATH would then be (pseudo-code):

./bin : (rbenv shims) : /usr/local/bin : /usr/bin

Also, just a heads-up for the future, which rake might not show you the correct result if you've just changed PATH in this shell. This is due to caching; some shells cache the location of rake for performance reasons. So after you change PATH, you should call hash -r in your shell just in case, or use command which rake which actually calls the which executable on the filesystem rather than which shell built-in. You have every right to be confused; this stuff is hard! :(

The rbenv which command is not PATH-aware; it just looks at the currently selected version to find the rake executable. This doesn't reflect what would actually be run when you run rake, though.

Your PATH is correct, so running which rake should show /path/to/yourproject/bin/rake, which means everything is as you wanted. Now all calls to rake in your project will activate the local binstub and not ~/.rbenv/versions/2.0.0-p247/bin/rake.

sshd should use your $HOME/.ssh/authorized_keys by default. I'm not sure why you had to enable it explicitly.

Thanks, bad paste. Now fixed

For beginners/intermediate: Vim Revisited is my article where I present similar information but in a more structured format.

Posted to Keep TODOs in git over 1 year ago

@mustardhamsters I don't find this complicated. It's a shell one-liner that you invoke with a single keyword, and git rebase -i should already be a part of your workflow regardless.

But I do understand your concern. This isn't a strong solution for storing long-term TODOs, and I should have stressed that out. It's just a silly hack to store quick TODOs for yourself as you're hacking away on a topic branch. Yes, I use this for myself, but for long-term TODOs I as well use a local todo.txt file or GH issues. I'll amend the text above.

Absolutely no benefit, except that I find shorter = easier to read.

You didn't tell us what it takes a picture of. I had to look at the docs for imagesnap.

For others: this script takes a photo of you via webcam.

Shortened version of the script: https://gist.github.com/4564682

Achievements
1,437 Karma
95,591 Total ProTip Views