how to install rails 4 via shell in ubuntu

i'm using the version 3, but i have a book that covers rails 4. please
tell me a way to easy install it!

Attachments:
http://www.ruby-forum.com/attachment/10036/Screenshot_from_2014-09-01_23_45_05.png

gem install rails -v '4.1.5' (or whatever version you need)

Good luck.

thanks, worked well!