Comments (3)
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.
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.
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)
- version `GLIBC_2.38' not found HOT 2
- `rbenv doctor` warns about multiple paths, one symlinks to the other HOT 1
- homebrew ruby: gem command not found
- Multiple instances of rbenv-install HOT 2
- `gem-rehash` inop for `bundle install`
- GOV UK
- Shim doesn't work for Ruby 3.3.0 HOT 5
- Error when use "gem" HOT 1
- readme installation guide missing step? HOT 1
- install ruby 3.2.0 rbenv/1.1.2/libexec/rbenv: No such file or directory
- bundle command does not do anything. HOT 2
- Issues with Ruby Version Not Matching Gemfile Specification and Bundler Path on macOS Ventura HOT 9
- rbenv.bash: line 8: syntax error near unexpected token `(' HOT 6
- Permission issues on MacOS besides set the ruby version with rbenv HOT 3
- Compile a list of all places where we change what is shown on the printed version of a page
- Zsh completions doesn't display list of available commands when pressing tab HOT 10
- Ruby
- Gem
- macOS installation - last step needs clarification HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbenv.