asdf global elixir path:<PATH> doesn't work

Created on 9 Aug 2019  路  13Comments  路  Source: asdf-vm/asdf

Steps to reproduce

$ git clone [email protected]:elixir-lang/elixir.git
$ asdf global elixir path:$PWD/elixir
sed: 1: "s/^elixir .*$/elixir pa ...": bad flag in substitute command: 'U'
rm: /Users/wojtek/src/dotfiles/asdf/.tool-versions.bak: No such file or directory

Furthermore, If I manually add to ~/.tool-versions:

elixir path:/Users/wojtek/elixir

then I get:

$ iex
asdf: No version set for command iex
you might want to add one of the following in your .tool-versions file:

elixir 1.9.0-rc.0-otp-22
elixir 1.9.0-otp-22

Expected behavior

Setting and using path option should work.

Environment

OS: macOS

asdf version: v0.7.2

bug

Most helpful comment

Fixed!

All 13 comments

Thanks for reporting this. Definitely a bug.

I'll have a fix for this out shortly.

I've merged the fix. I'll be tagging a new release of asdf shortly.

Thank you! I tried double checking it:

cd ~/.asdf
git checkout master
git pull origin master
asdf global elixir path:/Users/wojtek/src/elixir

but still see:

iex --version
asdf: No version set for command iex
you might want to add one of the following in your .tool-versions file:

elixir 1.9.0-rc.0-otp-22
elixir 1.9.0-otp-22
elixir git

let me know if you want me to test anything, maybe I'm missing something how to properly use master.

Maybe try asdf reshim? It's possible there is more to this issue.

Yeah, already tried that, no luck.

Yes there is another problem here. Not sure what is going on but it's not working for me either.

@Stratus3D any motion on this?

@zachdaniel I started digging into this again this morning. Hoping to have a PR out to fix this sometime this afternoon!

Fixed!

What should we do if this is still happening?

Solution for me was to manually create ~/.tool-versions and add the content

elixir 1.10.3-otp-23
erlang 23.0.1

Not sure why, but ~/.tool-versions was not created when I installed asdf, and the getting started doesn't mention this file in the install instructions.

What should we do if this is still happening?

Elixir path:<path to elixir> versions are not working for you? I've verified they work for me on two operating systems.

Not sure why, but ~/.tool-versions was not created when I installed asdf, and the getting started doesn't mention this file in the install instructions.

That file is only ever created when you set a version in a directory using asdf global or asdf local. This is by design. If you don't have a .tool-versions file no tool versions are used.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomsquest picture tomsquest  路  4Comments

johnjelinek picture johnjelinek  路  3Comments

kevinkjt2000 picture kevinkjt2000  路  4Comments

niksfirefly picture niksfirefly  路  3Comments

jayvdb picture jayvdb  路  4Comments