Comments (5)
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.
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.
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:
- Install [email protected] in mise.
- Create empty directory.
- Create
.mise.toml
file with content3.2.0
in the directory from the previous step. - Open that directory in the console.
- Run
ruby -v
. Output isruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin23]
- system ruby. - 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.
@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.
Thank you for the clarification!
from mise.
Related Issues (20)
- Docs is not clear enough
- `mise list-all xxx` requires xxx
- Can `mise` include project lifecycle commands HOT 1
- namespace in toml used for custom config
- support for php HOT 1
- Compatibility Issue: gem Executable Check in Mise Prevents Artichoke and mruby Installation
- Sporadic `munmap_chunk: invalid pointer` or `corrupted size vs. prev_size`, `corrupted double-linked list` crashes installing ruby on Ubuntu 24.04 arm64 HOT 3
- Started getting backtrace in 2024.6.6: `src/plugins/script_manager.rs:178`
- Add a MISE_TASK_OUTPUT="keep-order' to not mix the task output HOT 1
- Introduce jetbrains mise plugin HOT 1
- Three suggestions for docs
- [mise 2024.7.0] Error Symbol not found: _ASN1_OCTET_STRING_free
- Missing a way to ignore .tool-versions HOT 2
- mise + direnv (use mise) + venv; virtual env gets randomly deactivated
- Support envars in plugin urls HOT 1
- Documentation for .mise.toml syntax for renovate manager
- Completion file installation
- MISE_DATA_DIR not used during ansible task
- Latest mise releases not available via Homebrew HOT 6
- Mise wipe RUBYLIB value when works with RubyMine
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 mise.