curriculum icon indicating copy to clipboard operation
curriculum copied to clipboard

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

Open I3uckwheat opened this issue 3 years ago • 29 comments

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.

I3uckwheat avatar Jan 07 '22 15:01 I3uckwheat

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?

7ze avatar Jan 07 '22 15:01 7ze

@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?

I3uckwheat avatar Jan 07 '22 16:01 I3uckwheat

@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.

xandora avatar Jan 07 '22 20:01 xandora

@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.

7ze avatar Jan 08 '22 08:01 7ze

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

crespire avatar Feb 07 '22 18:02 crespire

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

7ze avatar Feb 09 '22 05:02 7ze

@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

Maheshkumar-novice avatar Feb 15 '22 04:02 Maheshkumar-novice

@Maheshkumar-novice sure, updating it

7ze avatar Feb 23 '22 15:02 7ze

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

thatblindgeye avatar Mar 14 '22 19:03 thatblindgeye

Hi, Any updates on this issue?

Maheshkumar-novice avatar Jun 04 '22 05:06 Maheshkumar-novice

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.

xandora avatar Jun 04 '22 06:06 xandora

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

Maheshkumar-novice avatar Jun 04 '22 06:06 Maheshkumar-novice

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

github-actions[bot] avatar Jul 06 '22 02:07 github-actions[bot]

LIES. I am dealing with it. I promise.

xandora avatar Jul 06 '22 02:07 xandora

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

crespire avatar Mar 09 '23 18:03 crespire

@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.

xandora avatar Mar 10 '23 08:03 xandora

@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.

crespire avatar Mar 10 '23 11:03 crespire

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

github-actions[bot] avatar May 10 '23 01:05 github-actions[bot]

@xandora how we doing on this?

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

codyloyd avatar Jun 07 '23 14:06 codyloyd

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

xandora avatar Jun 07 '23 17:06 xandora

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

github-actions[bot] avatar Jul 20 '23 01:07 github-actions[bot]

@xandora

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

CouchofTomato avatar Jul 20 '23 08:07 CouchofTomato

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

xandora avatar Jul 20 '23 08:07 xandora

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

github-actions[bot] avatar Aug 21 '23 01:08 github-actions[bot]

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.)

macauleydev avatar Dec 17 '23 17:12 macauleydev

@xandora

Are you happy for help as per comment above?

CouchofTomato avatar Dec 18 '23 15:12 CouchofTomato

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

crespire avatar Dec 19 '23 16:12 crespire

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.

macauleydev avatar Dec 20 '23 14:12 macauleydev

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

github-actions[bot] avatar Jan 20 '24 01:01 github-actions[bot]