Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"No version is set" when version is set and returned by asdf current. #488

Closed
adamu opened this issue Mar 21, 2019 · 28 comments · Fixed by #494
Closed

"No version is set" when version is set and returned by asdf current. #488

adamu opened this issue Mar 21, 2019 · 28 comments · Fixed by #494

Comments

@adamu
Copy link

adamu commented Mar 21, 2019

Steps to reproduce

I'm setting up a dockerfile based on alpine linux for an elixir build environment.
Here is an example session:

$ echo $PATH
/root/.asdf/bin:/root/.asdf/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.0
<clones asdf...>
$ asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
<installs elixir plugin...>
$ asdf install elixir 1.8
==> Copying release into place
$ asdf global elixir 1.8
$ asdf current
elixir         1.8      (set by /root/.tool-versions)
$ which elixir
/root/.asdf/shims/elixir
$ asdf which elixir
asdf: No version set for command elixir
you might want to add one of the following in your .tool-versions file:
$ elixir
asdf: No version set for command elixir
you might want to add one of the following in your .tool-versions file:

Expected behavior

asdf which elixir should return version 1.8 and elixir should execute the binary.

Actual behavior

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

Environment

OS: Alpine Linux in a docker container

asdf version: 0.7.0

Here is the WIP Dockerfile:

FROM alpine:3.9

ENV ASDF_VERSION "v0.7.0"
ENV ERLANG_VERSION "21.3"
ENV ELIXIR_VERSION "1.8"

RUN apk add --update --no-cache bash git curl perl alpine-sdk autoconf ncurses ncurses-dev && \
      git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch $ASDF_VERSION && \
      echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc

SHELL ["/bin/bash", "-ic"]

RUN asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git && \
      asdf install elixir $ELIXIR_VERSION && \
      asdf global elixir $ELIXIR_VERSION


ENTRYPOINT bash 
@adamu adamu changed the title "No version is set" when version is set. "No version is set" when version is set and returned by asdf current. Mar 21, 2019
@hez
Copy link

hez commented Mar 21, 2019

I am getting this in a lot of languages after updating to the latest ver.

example:

$ cat .tool-versions
elixir 1.8.0
erlang 21.2
nodejs 8.11.3
$ asdf install
elixir 1.8.0 is already installed
erlang 21.2 is already installed
nodejs 8.11.3 is already installed
$ erl
asdf: No version set for command erl
you might want to add one of the following in your .tool-versions file:

erlang 21.0
erlang 21.2.2

@danhper
Copy link
Member

danhper commented Mar 21, 2019

Could you give it a try on master and let us know how that goes please?

@adamu
Copy link
Author

adamu commented Mar 22, 2019

Same results on master:

bash-4.4# pwd
/root/.asdf
bash-4.4# git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
bash-4.4# asdf current
elixir         1.8      (set by /root/.tool-versions)
bash-4.4# asdf which elixir
asdf: No version set for command elixir
you might want to add one of the following in your .tool-versions file:

@adamu
Copy link
Author

adamu commented Mar 22, 2019

I downgraded to 0.6.3, and it's working there:

bash-4.4# git log -1 | cat
commit 1886e00cf18f5e9d3c5ac1bd18426d04121d4472
Author: John Doe <[email protected]>
Date:   Sat Jan 19 09:14:56 2019 -0500

    Update version to 0.6.3
bash-4.4# asdf which elixir
/root/.asdf/installs/elixir/1.8/bin/elixir

@danhper
Copy link
Member

danhper commented Mar 22, 2019

Thanks for trying out. I will take a closer look.

@danhper
Copy link
Member

danhper commented Mar 23, 2019

@adamu Thanks a lot for the report and the Dockerfile.
This should now be fixed. Could you give it another try and let me know how it goes please?
Thank you.

@hez Could you please check if your issue is fixed on the master branch please? If it is not, could you please open another issue with a little more information about your environment. Thank you.

@adamu
Copy link
Author

adamu commented Mar 23, 2019

Works on master for me.

bash-4.4# echo $ASDF_VERSION
master
bash-4.4# asdf which elixir
/root/.asdf/installs/elixir/1.8/bin/elixir

I don't really want to depend on master though, so I hope you will release 0.7.1 🙃

@danhper
Copy link
Member

danhper commented Mar 23, 2019

Yes, we'll release a new version very soon!

@jpinnix
Copy link

jpinnix commented Apr 6, 2019

Just a note that I also had this issue, tested against master and now it works.

@hez
Copy link

hez commented Apr 6, 2019

👍looks to be resolved in the latest ver

@danhper
Copy link
Member

danhper commented Apr 7, 2019

Thanks for your help! 0.7.1 should work how you expect!

@bowmanmike
Copy link

bowmanmike commented Apr 15, 2019

Hey @danhper , I'm still having this same issue with asdf version 0.7.1 and ruby. I've got my .ruby-version file in the directory, and my ~/.asdfrc has legacy_version_file = yes. I'm on a Mac running High Sierra, and the required Ruby version is installed. Additionally, even if I create a .tool-versions file, I still get the "No version set for command ruby" error message.

image

@Stratus3D
Copy link
Member

@bowmanmike it looks like you've specified Ruby version 2.3.4 but don't have that version installed (see the list in your screenshot that printed with you ran ruby --version). Installing that version of Ruby should fix the issue. Feel free to create another issue to improve the error message here. The version is set, but that version is not installed. The message could definitely be improved.

@bowmanmike
Copy link

@Stratus3D I do have 2.3.4 installed, as shown here:
image

@Stratus3D
Copy link
Member

Maybe try asdf reshim? If that version is installed and you've set that version in your directory it should work. If this issue manifests in multiple directories or across multiple plugins (e.g. elixir, python, etc...) please open a new issue.

@bowmanmike
Copy link

That seemed to work! Thanks!

@eksperimental
Copy link

eksperimental commented Apr 30, 2019

still having this issue with v0.7.1 even after asdf reshim

I'm getting

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

elixir 1.4.4
elixir 1.7.4
elixir 1.8.0
elixir 1.8.1

and my .tool-versions is

erlang 21.0.6
elixir path:/home/eksperimental/elixir/

@danhper
Copy link
Member

danhper commented Apr 30, 2019

@eksperimental Could you open another issue please? I suppose there has been a regression for how we handle path: versions.

@7stud
Copy link

7stud commented May 30, 2019

I installed a new version of elixir, then I updated asdf, and now I get the error:

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

More info:

~$ asdf --version
v0.7.2

~$ asdf list elixir
  1.6.6
  1.8.2

~$ asdf current
elixir         1.8.2    (set by /Users/7stud/.tool-versions)
erlang         20.3     (set by /Users/7stud/.tool-versions)

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

elixir 1.6.6
~$ 

And, here is .tool-versions (which I have never touched):

~$ cat .tool-versions 
elixir 1.8.2
erlang 20.3

OSX 10.13.6

=========

Okay, this worked for me:

$ asdf reshim elixir

@eksperimental
Copy link

@7stud this has been fixed on master in #524
Does it work?

@joemsak
Copy link

joemsak commented Jun 19, 2019

v0.7.2 on a fresh mojave install here, same problem with ruby, reshim does nothing

EDIT sorry just saw "fixed in master" will try to use master

UPDATE - sorry, doesn't seem to be working right for me

> asdf update --head
Already on 'master' (<------ this is because I had gone to ~/.asdf and ran `git checkout master` before seeing the help info on how to do it with the command)
Your branch is up to date with 'origin/master'.
From https://github.com/asdf-vm/asdf
 * branch            master     -> FETCH_HEAD
Already up to date.
Current branch master is up to date.
Updated asdf to latest on the master branch
> asdf reshim ruby  
> ruby -v
asdf: No version set for command ruby
you might want to add one of the following in your .tool-versions file:

ruby 2.6.3
> asdf local ruby 2.3.3
> cat .tool-versions 
ruby 2.3.3
nodejs 9.11.2
python 3.7.3
> cd ..
> cd -
> ruby -v
asdf: No version set for command ruby
you might want to add one of the following in your .tool-versions file:

ruby 2.6.3

UPDATE 2 - just noticed I'm working out of a DIR in the new macOS Catalina "macintosh HD - data" faux-partition (I just reformatted my drive, and downgraded back to Mojave, though) - that might have something to do with it - will update!

Update 3 - Sorry again, still doesn't seem to be working

> pwd
/Users/joemsak/work/<project name redacted>
> asdf current ruby
2.3.3    (set by /Users/joemsak/work/<project name redacted>/.tool-versions)
> asdf reshim ruby
> ruby -v
asdf: No version set for command ruby
you might want to add one of the following in your .tool-versions file:

ruby 2.6.3
> cd ..
work % cd -
~/work/<project name redacted>
> cd /Volumes/Macintosh\ HD/Users/joemsak/work/<project name redacted> 
> asdf reshim ruby
> ruby -v                                                
asdf: No version set for command ruby
you might want to add one of the following in your .tool-versions file:

ruby 2.6.3
>

@joemsak
Copy link

joemsak commented Jun 19, 2019

Heads up, it might be related to downgrading from the Catalina beta - https://twitter.com/infinitebrkfst/status/1141395765731790848 - my only problem on the beta was how piss-poor Finder was performing: constant beachball for normal tasks such as alt-tabbing from another app to Finder, or selecting a file to highlight it, or closing the finder window

@kvokka
Copy link

kvokka commented Jun 22, 2019

I'm using macOS 10.14.5 Mochave (and I did not even tried to install 10.15), but i'm facing the same issue.

I even tried to remove all previous ruby installations with no luck.

$ cat ~/.tool-versions
ruby 2.6.3
$ asdf list ruby
  --definitions
  2.6.3
$ ruby -v
asdf: No version set for command ruby
you might want to add one of the following in your .tool-versions file:

ruby 2.6.3

@kvokka
Copy link

kvokka commented Jun 22, 2019

@adamu @danhper Can you, please, re-open the issue? Or it is better to create the new one?

@danhper
Copy link
Member

danhper commented Jun 22, 2019

I don't think the issue you are having is the same one as the original one so could you please open a new issue with a description of your problem. Thanks!

@kvokka
Copy link

kvokka commented Jul 23, 2019

Occasionally I got this issue again, with trying to make fresh installation of ruby 2.1.10. (so it was impossible to run bundler with 2.1.10)

It was surprisingly resolved with installing ruby 2.1.9, and after it bundler works in both versions. Maybe it help someone

@kaka-ruto
Copy link

gem update --system solved for me, incase you messed up your system gems like me

@mconyango
Copy link

Run these commands:
asdf global elixir <version>
asdf global erlang <version>

To check the version of elixir or erlang run this command:
asdf list elixir or asdf list erlang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.