Git Product home page Git Product logo

rubyinstall-mac's Introduction

RUBYINSTALL-MAC

Install Ruby on Mac

Getting Started

Check Current Version of ruby and rails

Prerequisites

Make sure XCode is installed

$ xcode-select --install

Make sure Homebrew is up to date

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Installing

Install GPG

You can use Homebrew to install gpg, an encryption program used to check the security of the RVM download. Installing gpg eliminates a warning message which will halt installation of RVM.

$ brew install gpg

After GPG is installed (or if it is already installed), install the security key for RVM:

$ command curl -sSL https://rvm.io/mpapis.asc | gpg --import -

If you skip the gpg steps you may not be able to install RVM.

Install RVM

$ \curl -L https://get.rvm.io | bash -s stable
Close and Reopen the Terminal

After installing RVM, you must close and reopen the Terminal window.

Alternatively, you can enter this command to refresh the terminal environment:

$ source ~/.rvm/scripts/rvm

Install Ruby

$ rvm install ruby-2.5.0

You may be asked to enter a password. When you enter the password, type carefully. You will not see the characters you enter.

Sometimes a precompiled version of Ruby is available. If not, it takes a long time (about five minutes) to install Ruby because the computer must compile the source code.

Verify that the newest version of Ruby is installed:

$ ruby -v
ruby 2.5.6.

Check what version of Ruby is being used as default

$ rvm list
   ruby-2.5.1 [ x86_64 ]
=* ruby-2.5.6 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

If you need to change from the system or version

either change what is being used

$ rvm use 2.5.6

or change the default

$ rvm --default use 2.5.6

Check and update gem

$ gem -v
2.6.10

Use gem update --system to upgrade the Ruby gem manager:

$ gem update --system

OPTIONAL Create Gemset

$ rvm 2.5.6
$ rvm gemset create testbay1

or

$ rvm use 2.5.6@testbay1 --create

switch to Testbay1

$ rvm gemset use testbay1

or go back to default

rvm gemset use default

Install Bundler

$ gem install bundler

Install Nokogiri

$ gem install nokogiri

Install Rails

$ gem install rails
Check Version of Rails
$ rails -v
Rails 5.2.0

Set Auto Completion

Add to the bottom of your .bash_profile

[[ -r $rvm_path/scripts/completion ]] && . $rvm_path/scripts/completion

rubyinstall-mac's People

Contributors

tvoboril avatar

Watchers

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