In your Applications folder, find “Utilities” and double click “Terminal”. We will use the terminal to install all of the programs. Well done! Pat yourself on the back! The hard part is done, and it’s time to move on to the next lesson! MacOSīefore we can install Ruby, we need to install some base packages. Where x represents the version available at the time you installed Ruby. The above command should return something similar to this: ruby 3.2.2pxx (20xx-xx-xx revision xxxxx) Inside the terminal, type: rbenv global 3.2.2 Once Ruby is installed, you need to tell rbenv which version to use by default. If so, we run the suggested command: git -C "$(rbenv root)"/plugins/ruby-build pull Git -C /home/itorja/.rbenv/plugins/ruby-build pull If the version you need is missing, try upgrading ruby-build: See all available versions with `rbenv install -list'. You may get this error message: ruby-build: definition not found: x.x.x While it installs, take this time to watch this video or to get a glass of water. The -verbose flag will show you what’s going on so you can be sure it hasn’t gotten stuck. This command will take 10-15 minutes to complete. Inside the terminal, run this command: rbenv install 3.2.2 -verbose It’s finally time to install Ruby using rbenv! If you do not get a version number at all (anything not starting with rbenv 1.), please ask for help in the Odin Project Chat Room. You should get an output with a version number similar to this: rbenv 1.2.0-14-gc6cc0a1 Git clone "$(rbenv root)"/plugins/ruby-buildįrom your terminal to verify that rbenv has been installed correctly. Run these commands in the terminal to create a directory for the ruby-build plugin and then download it to the proper directory. Next, you need to install ruby-build to help compile the Ruby binaries. echo 'export PATH="$HOME/.rbenv/bin:$PATH"' > ~/.bashrcĮcho 'eval "$(rbenv init -)"' > ~/.bashrcĪfter running the final exit command, you will need to close out of all open terminals and open a new terminal (see Step 1.1 above). Again, be sure to copy and paste these commands. They will not provide any output if done properly. Note: Run these commands one by one in sequence. We can use the Linux echo command to make it easy. Next, we’ll add some commands to allow rbenv to work properly. Step 2.1: Install rbenvįirst, you need to clone the rbenv repository. We’re going to use a tool called rbenv, which makes it easy to install and manage Ruby versions. You may or may not have to type your password after pressing Enter. When it prompts you, press Y and then Enter. sudo apt install gcc make libssl-dev libreadline-dev zlib1g-dev libsqlite3-dev libyaml-dev Next, you need to install some required packages that do not come preinstalled. Once you’re done typing your password, press Enter. When typing your password, you may not get any visual feedback, but rest assured that your password is being entered. Because these commands use sudo, you will have to enter your password in order for them to run. The rest of the installation will take place inside the terminal window.įirst, we need to make sure your Linux distribution is up to date. Quick tip: In Linux, you can copy from the terminal with Ctrl + Shift + C and paste with Ctrl + Shift + V. (This may work in other Linux distributions you’ll have to try!) If you’re using Ubuntu or Xubuntu, simply press Ctrl + Alt + T to open the terminal. We’ll use the terminal to install all of the programs. Step 1: Install updates, packages and librariesīefore we can install Ruby, we need to install some base packages. Ignore that and follow our instructions for now. In some instances, you might see a message in the terminal telling you to use sudo and install something with apt. Failing to follow this can cause a lot of headaches, and never run as the root user. Do NOT use sudo unless The Odin Project specifically says to do so.Follow the directions closely, and don’t skip over any sections.Copy and paste the commands to avoid typos.This section is where you could potentially encounter a lot of errors.īefore continuing, let’s review a few best practices to keep in mind: Before we start learning, we’ll need to install Ruby first.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |