Giter VIP home page Giter VIP logo

Comments (3)

jasonkarns avatar jasonkarns commented on June 2, 2024 1

It sounds like rbenv init is being invoked twice.

rbenv-init should not create duplicates but rather proceeds to prepend the sims to PATH regardless if they're already present. If your shell setup is already calling rbenv-init elsewhere, then the second invocation would create a second entry in PATH.

When rbenv-init runs, its job is to place the shims at the beginning of PATH. If it's called twice, they'll be added twice. The recommended fix is to not call rbenv-init twice.

Some more background: rbenv initially tried to be "clever" and only add the shims if they weren't present: 03fa148

This causes no end of problems thanks to poor handling of *rc and *profile files by some OS configurations (most notably, OS X back in the day). #369
See also the general problem: https://stackoverflow.com/questions/13058578/how-to-prevent-tmux-from-filling-up-the-global-path-variable-with-duplicated-pat

So the de-duping was subsequently reverted: e2173df

Current behavior is now intentional (rbenv-init simply prepends to PATH regardless of existing value).

from rbenv.

mislav avatar mislav commented on June 2, 2024

Hi, if you run rbenv init - fish, you can inspect the script that will be eval'd by your shell. This is it for me:

set -gx PATH '/Users/mislav/.rbenv/shims' $PATH
set -gx RBENV_SHELL fish
command rbenv rehash 2>/dev/null
function rbenv
  set command $argv[1]
  set -e argv[1]

  switch "$command"
  case rehash shell
    rbenv "sh-$command" $argv|source
  case '*'
    command rbenv "$command" $argv
  end
end

I only see the shims path being added once. Could it be that something else is adding another shims path, or that you're running a shell within a shell and that both edited PATH?

from rbenv.

RichardFevrier avatar RichardFevrier commented on June 2, 2024

Thanks for the answers, yes I've read the doc and saw rbenv init - fish before posting and also upgraded to the latest commit rbenv and checked my fish config 10 times, so yes I'm sure there are no duplicates.

Invoked only once and if I remove it and logout to be sure, no shims anymore (from rbenv) in my path.
I've also checked other globals and universal vars from fish.

Btw Fish already handles dupes in PATH if you use the fish idiomatic way fish_add_path -g $HOME/.rbenv/shims

I'll try on a second machine and let you know.

Edit:
Forgot to mention if you want to see my config by yourself here it is.

from rbenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.