Open bilus opened 4 years ago
Hi @bilus, my path does not end with a slash either:
ELISP> (getenv "PATH")
"/Users/sshaw/.rvm/gems/ruby-2.3.7/bin:/Users/sshaw/.rvm/gems/ruby-2.3.7@global/bin:/Users/sshaw/.rvm/rubies/ruby-2.3.7/bin:/Users/sshaw/.rvm/bin:/Users/sshaw/perl5/perlbrew/bin:/Users/sshaw/perl5/perlbrew/perls/perl-5.20.0/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Library/TeX/texbin:/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9:/Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_9:/Users/sshaw/.rvm/bin:/Users/sshaw/bin:/Users/sshaw/usr/bin:/usr/sbin:/usr/local/sbin:/Users/sshaw/.go/bin:/Users/sshaw/.cask/bin:/Users/sshaw/.jenv/bin"
But rvm-use
does work for me.
One thing I did notices is that rvm/info
returns two elements with the key "ruby"
:
ELISP> (rvm/info "2.5.2")
(("IRBRC" . "/Users/sshaw/.rvm/rubies/ruby-2.5.2/.irbrc")
;; <snip a ton of stuff>
("ruby" . "/Users/sshaw/.rvm/rubies/ruby-2.5.2/bin/ruby")
("ruby" . "/Users/sshaw/.rvm/rubies/ruby-2.5.2")
("gem" . "/Users/sshaw/.rvm/gems/ruby-2.5.2")
;; <snip more>
Mine works because assoc
finds the one with a binary since it comes first. Maybe this is the issue? Can you check what (rvm/info whatever-version)
returns for the "ruby"
key?
Nice package! Unfortunately, I found it doesn't quite work with my setup, possibly because I'm using fish.
Here's what my PATH looks like:
Notice the lack of a trailing slash. It makes the
rvm--change-path
function to fail becauservm/info
returns a path to the binary, which you strip of the executable name usingfile-name-directory
in thervm-use
function.I patched it locally, can submit a PR if you don't think it's a particularly awful solution:
I could rewrite it using regexp if you insist. :) I haven't tested it with other shells but I believe it should work with slashes in PATH as well.