Posts

Showing posts from January, 2015

Doing things in non ruby way

Image
In Ruby, If we need to add two integers we can simply use 6 + 8 Another approach is using method invoking and passing arguments We are using .(Dot which is also called period) to invoke +( Plus method ) and sending 8 as argument. Similarly for Ruby Array

Linux Cheat sheet

Image

Installing Ruby on Rails on OS X 10.10 Yosemite

This post will help you setup Ruby on Rails for OS X 10.10 Yosemite. This setup is also compatible for older versions of OS X. Installing Homebrew Homebrew helps us to install and compile software packages from the source. Open your terminal and type the following command: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Installing Ruby Once homebrew is finished installing, we can proceed to install Ruby. For now we will be using rbenv to install and manage our ruby versions. To do the following, type the following command in your terminal: brew install rbenv ruby-build # Add rbenv to bash so that it loads every time you open a terminal echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile source ~/.bash_profile # Install Ruby 2.1.5 and set it as the default version rbenv install 2.1.5 rbenv global 2.1.5 ruby -v # ruby 2.1.5 Installing Rails Once Ruby is con