Giter VIP home page Giter VIP logo

phase-0-wsl2-env-ruby's Introduction

Windows WSL2 Ruby Installation

Install Ruby Environment Manager (RVM) on Ubuntu

Ruby Environment Manager (RVM) is a tool that will allow you to download and install multiple versions of Ruby, one of the programming languages that we teach at Flatiron School. Installing RVM for Ubuntu is the first step in installing Ruby on your Ubuntu operating system.

Action Item

  1. Open the "Ubuntu" application using the "Start" menu
  2. Type sudo apt-get install software-properties-common and press <Enter>
  3. You may be asked to enter your Ubuntu terminal password
  4. Type sudo apt-add-repository -y ppa:rael-gc/rvm and press <Enter>
  5. Type sudo apt-get update and press <Enter>
  6. Type sudo apt-get install rvm and press <Enter> (Note: if you are asked "Do you want to continue [Y/n]", type "Y" and press <Enter>)
  7. Type sudo usermod -a -G rvm $USER and press <Enter>
  8. Close the "Ubuntu" application
  9. Open the "Ubuntu" application using the "Start" menu
  10. Type rvm and press <Enter>

Check Your Work

<iframe width="560" height="315" src="https://www.youtube.com/embed/tRLexZJS144" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

If you see a long message ending in "For additional documentation, please visit https://rvm.io", continue below. If rvm is not found, consult the troubleshooting steps in the Verify and Troubleshoot your WSL2 Environment Setup lesson later on in this module.

Install Ruby Version 2.7.4 on Ubuntu

For our Ruby labs and lessons, we recommend that students use Ruby version 2.7.4 on Ubuntu. If Ruby Environment Manager (RVM) has been successfully installed, you can quickly install Ruby with a couple of commands.

Action Item

  1. Open the "Ubuntu" application using the "Start" menu
  2. If the "Ubuntu" application is still open from the last step, close and re-open to prevent errors with running the next command.
  3. Type rvm install 2.7.4 --default and press <Enter>
  4. Enter your Ubuntu password if prompted
  5. Type rvm list and press <Enter>

Check Your Work

<iframe width="560" height="315" src="https://www.youtube.com/embed/KYr66fx3nzc" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

If you see a message starting with =* ruby-2.7.4, continue below.

Note: If you see that Ruby 2.7.4 is installed, but does not display =* before it, close and reopen the "Ubuntu" application, then run rvm use 2.7.4 --default.

Troubleshooting Ruby Installs

If you encounter issues installing a version of Ruby via RVM, try the following in Ubuntu:

  • Run rvm group add rvm $USER
  • Close Ubuntu and reopen
  • Run rvm fix-permissions

After running the last command, try installing Ruby again with rvm install 2.7.4 --default

If you are continuing to have issues installing RVM, try running the following:

$ sudo usermod -a -G rvm $USER

After running, try installing Ruby again.

Install Ruby Gems on Ubuntu

Ruby Gems are small programs written in Ruby that help you to code more easily in Ruby. The gems you will install today include: Bundler, which allows you to keep track of which gems your projects need to work, and Pry, which allows you to pause your Ruby code when it runs and inspect it.

Action Item

  1. Open the "Ubuntu" application using the "Start" menu
  2. Type gem update --system and press <Enter>
  3. Type gem install bundler and press <Enter>
  4. Type gem install pry and press <Enter>
  5. Type gem list and press <Enter>

Check Your Work

<iframe width="560" height="315" src="https://www.youtube.com/embed/QeLOsZzz5pk" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

If you are able to complete each step without any issues and see pry and bundler listed in the output from running gem list, continue to the next lesson, Configuring Git and GitHub on WSL2.

phase-0-wsl2-env-ruby's People

Contributors

maxwellbenton avatar graciemcguire avatar lizbur10 avatar ihollander avatar timothylevi avatar bal360 avatar timothylevi-test avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.