_partials/ruby.md
Now, you are ready to install the latest ruby version and set it as the default version.
Run this command, it will take a while (5-10 minutes)
rbenv install <RUBY_SETUP_VERSION>
Once the ruby installation is done, run this command to tell the system to use the <RUBY_SETUP_VERSION> version by default.
rbenv global <RUBY_SETUP_VERSION>
Reset your terminal and check your Ruby version:
exec zsh
Then run:
ruby -v
:heavy_check_mark: If you see something starting with ruby <RUBY_SETUP_VERSION> then you can proceed :+1:
:x: If not, ask a teacher
:warning: If you are in China, you should update the way we'll install gem with the following commands.
# China only!
gem sources --remove https://rubygems.org/
gem sources -a https://gems.ruby-china.com/
gem sources -l
# *** CURRENT SOURCES ***
# https://gems.ruby-china.com/
# Ruby-china.com must be in the list now
Everyone, in China or not, continue here to install gems.
In the ruby world, we call external libraries gems: they are pieces of ruby code that you can download and execute on your computer. Let's install some!
First, we'll update bundler, which is what lets us install gems:
gem update bundler
In your terminal, copy-paste the following command:
gem install <GEMS>
:heavy_check_mark: If you get xx gems installed, then all good :+1:
:x: If you encounter the following error:
ERROR: While executing gem ... (TypeError)
incompatible marshal file format (can't be read)
format version 4.8 required; 60.33 given
Run the following command:
rm -rf ~/.gemrc
Rerun the command to install the gems.
:warning: NEVER install a gem with sudo gem install! Even if you stumble upon a Stackoverflow answer (or the terminal) telling you to do so.