installing ruby

Attempting a Ruby version of the spiral algorithm, to get used to the Ruby syntax, for later getting familiar with using Rails for app building. Was recommended to use Ruby version 2.1.5 from a reputable source. Had an old version ruby 2.0.0, can’t remember where it was from. Probably came with the laptop or installed when I needed brew months ago?

Installing RVM and Ruby 2.1.5

I found which version I had with ruby -v and then found where it was linked using which ruby

From there I installed RVM first, then used RVM to install Ruby.

Install RVM with \curl -sSL | bash -s stable

Then you can install a specific version of Ruby rvm install 2.1.5 -C --with-readline-dir=HOME/.rvm/usr

The results take a while, I stepped away while it was installing.

Screenshot of installing RVM

In the end I still had to fiddle a bit to get the right ruby version in my environment path.

I moved the original Ruby to /usr/bin/ruby2.0 in case I need it in the future and then created a symlink `ln -s ~/.rvm/rubies/ruby-2.1.5/bin/ruby /usr/bin/ruby’

In a new terminal window, ruby -v will give me the version I want.