I’m sick of people who write tutorials which is not clear to install the Rails, too long, too much multiple choice, rambling. This is tutorial that actually works for me. Hope it would work for you too.
Install some dependencies first
$ sudo apt-get update $ sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs
And we install the ruby, the current new version when this post is written is ruby 2.4.1, you might want to change with the newer version if available.
$ wget http://ftp.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz $ tar xzvf ruby-2.4.1.tar.gz $ cd ruby-2.4.1 $ ./configure $ make $ sudo make install
Check the ruby version
$ ruby -v
Install bundler and Rails with gem
$ sudo gem install bundler $ sudo gem install rails
Check the Rails version
$ rails -v
Create new app
$ rails new my_new_app