TheOdinProject / curriculum

The open curriculum for learning web development
https://www.theodinproject.com/
Other
9.8k stars 13.16k forks source link

Convert `nvm` and `rvm` directions to use asdf instead #23284

Open I3uckwheat opened 2 years ago

I3uckwheat commented 2 years ago

Description

asdf is a package manager much like nvm, but has some very useful features. One of which being the terminal startup time, another being compatible with multiple languages and plugins. It is generally considered nicer to work with as well and has been gaining in popularity. It should also be used to handle Ruby.

Completion Criteria

Convert this file to use asdf to install Node instead of nvm.

Convert this file to use asdf to install Ruby instead of rvm.

7ze commented 2 years ago

I agree; asdf is simpler to set up too, and I use it on my work machine . I would love to do this. Can I pick this up?

I3uckwheat commented 2 years ago

@7ze Sure thing! Please try to get some verification on directions with the supported OSses within reason as well. The Discord chat is a good place to ask for some help. Touch base with me there if you need some help finding people.

It's all yours! Do you have an estimate when you can have this completed?

xandora commented 2 years ago

@7ze While testing I put together some minimum required code snippits, feel free to use these as a template while working on the changes.

Installing asdf

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.9.0
echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc
echo ". $HOME/.asdf/completions/asdf.bash" >> ~/.bashrc

NOTE: What about zsh or macOS users?

Installing nodejs with asdf

sudo apt-get install dirmngr gpg curl gawk
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf install nodejs lts
asdf global nodejs lts

Installing ruby with asdf

sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev
asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git
asdf install ruby 2.7.4
asdf global ruby 2.7.4

Verifying correct nodejs/Ruby versions are set globally

Run the following command in your terminal:

asdf current

Output should be similar to:

nodejs          lts             /home/michael/.tool-versions
ruby            2.7.4           /home/michael/.tool-versions

If output looks like this:

nodejs          ______          No version is set. Run "asdf <global|shell|local> nodejs <version>"
ruby            ______          No version is set. Run "asdf <global|shell|local> ruby <version>"

Run asdf global <nodejs|ruby> <version> to set the current global version.

nvm warning/error when launching VSCode

Investigate fix for following message if nvm is installed at the same time:

nvm is not compatible with the npm config "prefix" option: currently set to "/home/michael/.asdf/installs/nodejs/lts/.npm"
Run `npm config delete prefix` or `nvm use --delete-prefix v14.13.1 --silent` to unset it.
7ze commented 2 years ago

@I3uckwheat Thank you, I'll check in with the discord chat for sure. I should be able to complete this in a couple of days for sure.

@xandora Thank you so much for these snippets. Will keep them as a reference while making the changes.

crespire commented 2 years ago

Just to chime in, the Ruby version recommended in the curriculum is now 3.0.x, so users should make sure to install that version over 2.7.x.

As of writing this comment, the current version of Ruby is 3.0.3

7ze commented 2 years ago

sure will add that. Sorry it's taking so long, was sick for a while. I'll update this asap.

Maheshkumar-novice commented 2 years ago

@7ze

In case you don't know,

The node installation lesson mentioned above is now archived: https://github.com/TheOdinProject/curriculum/blob/main/foundations/installations/installing_node.md (you will get 404) https://github.com/TheOdinProject/curriculum/blob/main/archive/installing_node.md (it's moved to archives) So you don't need to update the above one. Instead you need to update the one below,

We now have a separate lesson for installing node.js here: https://github.com/TheOdinProject/curriculum/blob/main/foundations/javascript_basics/installing_nodejs.md

7ze commented 2 years ago

@Maheshkumar-novice sure, updating it

thatblindgeye commented 2 years ago

@7ze Just wanted to check on the status of this issue 🙂

Maheshkumar-novice commented 2 years ago

Hi, Any updates on this issue?

xandora commented 2 years ago

Hi, Any updates on this issue?

@Maheshkumar-novice I think we can probably consider this one abandoned. I'm going to unassign this. Are you interested in working on it? If not, I'll pick it up myself.

Maheshkumar-novice commented 2 years ago

@xandora You can pick it, I'm not interested.

github-actions[bot] commented 2 years ago

This issue is stale because it has had no activity for the last 30 days.

xandora commented 2 years ago

LIES. I am dealing with it. I promise.

crespire commented 1 year ago

Is this still active/required? I just made the switch from nvm/rbenv today to asdf so it's fresh on my mind.

xandora commented 1 year ago

@crespire I have most of the lessons converted, I just did the work on my mac, and I don't use that very often. I will try and get to figuring out the status over the weekend.

crespire commented 1 year ago

@crespire I have most of the lessons converted, I just did the work on my mac, and I don't use that very often. I will try and get to figuring out the status over the weekend.

If there are any you want to offload on the Linux side, let me know! Happy to help on that side.

github-actions[bot] commented 1 year ago

This issue is stale because it has had no activity for the last 30 days.

codyloyd commented 1 year ago

@xandora how we doing on this?

No rush or anything.. I'm just following up on some of our stale issues

xandora commented 1 year ago

I'm somewhere between half and done. Do we still want it?

github-actions[bot] commented 1 year ago

This issue is stale because it has had no activity for the last 30 days.

CouchofTomato commented 1 year ago

@xandora

I think it makes sense to switch to an in all one solution still. Are you happy to finish it off?

xandora commented 1 year ago

@CouchofTomato yup. I'll try and get it done over the next couple weeks.

github-actions[bot] commented 1 year ago

This issue is stale because it has had no activity for the last 30 days.

macauleydev commented 9 months ago

I'm trying out ASDF on macOS 14.0 now, and would be happy to update these Ruby Install instructions based on documentation & any issues/caveats I run into.

(I could also update the Linux instructions based on documentation, but don't currently have a testing environment for that.)

CouchofTomato commented 9 months ago

@xandora

Are you happy for help as per comment above?

crespire commented 9 months ago

I'm also able to help and have both linux and macOS at my disposal now.

macauleydev commented 9 months ago

For what it's worth, the following two pages of instructions from Daniel Kehoe (for installing on macOS: asdf then Ruby) are simpler than asdf documentation & worked smoothly for me (macOS 14.0, Ruby 3.2.2).

https://mac.install.guide/ruby/5.html https://mac.install.guide/ruby/6.html

My only change would be, after brew install asdf, to verify installation & list dependencies with the single command brew deps --tree --installed asdf.

github-actions[bot] commented 8 months ago

This issue is stale because it has had no activity for the last 30 days.