How cool does Firebase look?! Thank you Courtney! Hi! I'm Mike!! I'm a Ruby developer from the UK. I'm going to talk about making it easier to install & switch between languages.
I like to mess around with different languages, especially on Exercism channel. It's fun to install a new language one weekend & play about! But out the box, installing languages is kind of tricky.
Question to ask yourself! Do you remember? Was it a good experience? Did you use homebrew, did you have to following some weird instructions online?
When I first started in dev, I used WAMP! I remember just clicking "next" on an installer, then I just I just had like everything I needed. I don't remember it ever telling me what version numbers I installer, but it was so cool!
Now I do Ruby a lot...I don't think there is a _right way_ to install it 🤫 On their website it gives like a few choices...
If you want to run different versions of ruby, There are 59 million pages telling you slightly different ways to do it.
Though other languages have the same issue.
I just want to get coding, then figure out the nuances of installing it later.
I found two tools which are super awesome! I'm going to cover Docker in a future talk! For now we're going to focus on asdf.
I started using this tool a few months ago & really liked it. asdf: It's a bit like homebrew, if anyone has used that. You can install a bunch of languages, but it was also designed to make switching between language versions easier. E.g. You want to run the latest Ruby on one project, but on another project it's running an older version. It just kind of handles it.
It has a really super install page, where you can put in your setup & it'll give you tailored install instructions. I liked that! Super awesome!
Once you have asdf setup, It's approachable to get a new language setup.
The "plugin add" line is saying "give me the resources to install ruby". Behind the scenes it has a neat plugin architecture which lets anyone create a way to install plugins. So if someone was to release something new you could get access to it pretty fast.
Then the next two commands are: - Lets install this version of ruby - Lets use this version of ruby globally (The default version), so when nothing else is set.
You might have to open a new tab. Then once that's done, you can start running ruby commands.
To install python, it's similar
To install same with yarn I think that's really nice!
Pretty often you'll probably have to run multiple versions of a tool. Here is how you do it!
I mentioned it's good for managing multiple versions of languages. Within a projects folder you can run a command which pretty much says: "Everything under this folder, run this version of this language" And it'll create a `.tool-versions` to keep track of what you chose, everything under it will use what's defined in the file. Assuming you've got that version installed, it'll just work.
Once you know about that .tools-version file, you'll start seeing it everywhere!
If you don't have it right installed you can run the "asdf install" command, and it'll make sure you've got the right version installed. This is super hand for if you're working in a team & that `.tool-version` file is in version control.
If you do ever get stuck, they have a super good help command.
You made it! BREATH! Hopefully that gave you enough feel like you can totally go try new languages without to many walls. If you have questions, ping me on Slack or on Twitter :)