GithubHelp home page GithubHelp logo

Comments (5)

jdx avatar jdx commented on July 16, 2024 1

Run ruby -v. Output is ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin23] - still system ruby

Because mise shell is a shell function that sets environment variables. A CLI cannot do that.

If I want to use some other ruby version just for several commands, I don't want to change the value in config.

that's what mise shell is for. mise needs to change something (an env var or config file) so it knows which version to use.

from mise.

jdx avatar jdx commented on July 16, 2024

Now try to select a different ruby version in mise. After the change, it changes back to the version from the config.

I don't know what this means. Are you talking about mise use? If so, .mise.toml files take precedence over legacy config files like .ruby-version.

from mise.

DmitryPogrebnoy avatar DmitryPogrebnoy commented on July 16, 2024

It is more about mise shell. Let me explain it in more detail. The same steps work also for .mise.toml files, let suppose that we have .mise.toml for simplicity.

Complete steps for the reproduction:

  1. Install [email protected] in mise.
  2. Create empty directory.
  3. Create .mise.toml file with content 3.2.0 in the directory from the previous step.
  4. Open that directory in the console.
  5. Run ruby -v. Output is ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin23] - system ruby.
  6. Run mise list ruby. Output is:
Plugin  Version  Config Source                     Requested
ruby    3.2.0    ~/Desktop/mise_example/.mise.toml 3.2.0    
ruby    3.3.0                                                                                                                             

So the version is automatically selected by 3.2.0. because it is stated in the config file. It is expected.
Now suppose you would like to use some other version of ruby in the console. Then your next step is the following:
7. Run /Users/dmitry.pogrebnoy/.local/bin/mise shell [email protected].
On that step I expect that now I have ruby 3.3.0 enabled. Let's check:
8. Run ruby -v. Output is ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin23] - still system ruby.
9. But! If I call mise shell [email protected], then the version will change to 3.3.0.
10. Let's check. Run ruby -v. Output is ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23].

Could you please explain why it works as it is? I expect that it should work the same in both cases.

from mise.

DmitryPogrebnoy avatar DmitryPogrebnoy commented on July 16, 2024

@jdx Also, some kind of a related question is why mise use ruby@<something> changes not only the currently selected ruby version, but also a value in .mise.toml config file? If I want to use some other ruby version just for several commands, I don't want to change the value in config.

from mise.

DmitryPogrebnoy avatar DmitryPogrebnoy commented on July 16, 2024

Thank you for the clarification!

from mise.

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.