Ruby on Rails on Linux

Terminal

We're going to do all this stuff in the terminal. Suck it up Buttercup. If terminal makes you queazy, it's time to learn. Log on to your Ubuntu VM and hit Search your computer in the top left. Type term and click Terminal.

apt-get

Alright. Now that we have a Linux virtual machine, let's get Ruby on Rails running. First up, we need to do the Linux version of Windows Update:

prawnhead@ubuntu:~$ sudo apt-get update  
prawnhead@ubuntu:~$ sudo apt-get upgrade

We need to run these two commands. In my experience nothing weird happens when you do. It just updates components on your Linux system. apt-get update also updates the machine's internal catalog of what software is available and which versions. If apt-get upgrade asks for permission, just go ahead.

Now we'll see if the programming language Ruby is already installed and see if the Ruby on Rails framework is there too.

 prawnhead@ubuntu:~$ ruby -v  
 The program 'ruby' is currently not installed. You can install it by typing:  
 sudo apt install ruby  
 prawnhead@ubuntu:~$ rails -v  
 The program 'rails' is currently not installed. You can install it by typing:  
 sudo apt install ruby-railties  
 prawnhead@ubuntu:~$  

I expect, like me, you'll find neither is there. If you're installing on a Mac or some other operating system, don't worry if you see a version of Ruby already installed. Systems run fine with multiple versions of Ruby and the procedure we'll use handles management of the different installed versions.

Install Ruby on Rails

Now we defer to the GoRails procedure: https://gorails.com/setup/ubuntu/14.04

  • Make sure you have the correct Ubuntu version selected at the top of the page
  • Use all the recommended defaults
  • Feel free to skip Configuring Git unless you know you want to use Git
  • You can skip Setting Up MySQL and/or Setting Up PostgreSQL. Rails uses SQLite by default so you don't have to use either MySQL or PostgreSQL
  • Take your time!

I recommend copy-pasting text from the procedure into your terminal window. Be aware of changed key bindings when working between host operating system and virtual machine. On my Mac I have to use Command-C to copy in Safari and Shift-Control-V to past into Ubuntu on Parallels. In Terminal you can use the cursor up/down keys on the keyboard to cycle through the commands you've already used, either to see what you did wrong or to repeat a command you've already used.

These are my terminal dumps of running through the procedures.

Install Ruby on Rails (2.4.0)

 prawnhead@ubuntu:~$ 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  
 Reading package lists... Done  
 Building dependency tree    
 Reading state information... Done  
 build-essential is already the newest version (12.1ubuntu2).  
 The following additional packages will be installed:  
  git git-man icu-devtools liberror-perl libicu-dev libreadline6-dev libssl-doc libtinfo-dev libuv1  
  python-apt python-pycurl  
 Suggested packages:  
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs  
  git-mediawiki git-svn libcurl4-doc libcurl3-dbg libidn11-dev libkrb5-dev libldap2-dev librtmp-dev  
  icu-doc readline-doc sqlite3-doc libyaml-doc python-apt-dbg python-apt-doc libcurl4-gnutls-dev  
  python-pycurl-dbg python-pycurl-doc  
 The following NEW packages will be installed:  
  curl git git-core git-man icu-devtools libcurl4-openssl-dev liberror-perl libffi-dev libicu-dev  
  libreadline-dev libreadline6-dev libsqlite3-dev libssl-dev libssl-doc libtinfo-dev libuv1 libxml2-dev  
  libxslt1-dev libyaml-dev nodejs python-apt python-pycurl python-software-properties sqlite3  
  zlib1g-dev  
 0 upgraded, 25 newly installed, 0 to remove and 0 not upgraded.  
 Need to get 21.5 MB of archives.  
 After this operation, 105 MB of additional disk space will be used.  
 Do you want to continue? [Y/n] y  
 Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 curl amd64 7.47.0-1ubuntu2.2 [139 kB]  
 Get:2 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 liberror-perl all 0.17-1.2 [19.6 kB]  
 Get:3 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 git-man all 1:2.7.4-0ubuntu1 [735 kB]  
 Get:4 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 git amd64 1:2.7.4-0ubuntu1 [3,006 kB]    
 Get:5 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 git-core all 1:2.7.4-0ubuntu1 [1,464 B]    
 Get:6 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 icu-devtools amd64 55.1-7 [165 kB]       
 Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libcurl4-openssl-dev amd64 7.47.0-1ubuntu2.2 [262 kB]  
 Get:8 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libicu-dev amd64 55.1-7 [8,546 kB]       
 Get:9 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libtinfo-dev amd64 6.0+20160213-1ubuntu1 [77.4 kB]  
 Get:10 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libreadline6-dev amd64 6.3-8ubuntu2 [124 kB]  
 Get:11 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libreadline-dev amd64 6.3-8ubuntu2 [992 B]  
 Get:12 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libsqlite3-dev amd64 3.11.0-1ubuntu1 [508 kB]  
 Get:13 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 zlib1g-dev amd64 1:1.2.8.dfsg-2ubuntu4 [168 kB]  
 Get:14 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libssl-dev amd64 1.0.2g-1ubuntu4.6 [1,344 kB]  
 Get:15 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libssl-doc all 1.0.2g-1ubuntu4.6 [1,079 kB]  
 Get:16 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 libuv1 amd64 1.8.0-1 [57.4 kB]      
 Get:17 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libxml2-dev amd64 2.9.3+dfsg1-1ubuntu0.1 [743 kB]  
 Get:18 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libxslt1-dev amd64 1.1.28-2.1 [406 kB]   
 Get:19 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 python-apt amd64 1.1.0~beta1build1 [139 kB]  
 Get:20 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 python-pycurl amd64 7.43.0-1ubuntu1 [43.3 kB]  
 Get:21 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python-software-properties all 0.96.20.5 [20.3 kB]  
 Get:22 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 sqlite3 amd64 3.11.0-1ubuntu1 [515 kB]   
 Get:23 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libffi-dev amd64 3.2.1-4 [161 kB]       
 Get:24 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libyaml-dev amd64 0.1.6-3 [55.2 kB]      
 Get:25 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 nodejs amd64 4.2.6~dfsg-1ubuntu4.1 [3,161 kB]  
 Fetched 21.5 MB in 18s (1,141 kB/s)                                   
 Selecting previously unselected package curl.  
 (Reading database ... 207774 files and directories currently installed.)  
 Preparing to unpack .../curl_7.47.0-1ubuntu2.2_amd64.deb ...  
 Unpacking curl (7.47.0-1ubuntu2.2) ...  
 Selecting previously unselected package liberror-perl.  
 Preparing to unpack .../liberror-perl_0.17-1.2_all.deb ...  
 Unpacking liberror-perl (0.17-1.2) ...  
 Selecting previously unselected package git-man.  
 Preparing to unpack .../git-man_1%3a2.7.4-0ubuntu1_all.deb ...  
 Unpacking git-man (1:2.7.4-0ubuntu1) ...  
 Selecting previously unselected package git.  
 Preparing to unpack .../git_1%3a2.7.4-0ubuntu1_amd64.deb ...  
 Unpacking git (1:2.7.4-0ubuntu1) ...  
 Selecting previously unselected package git-core.  
 Preparing to unpack .../git-core_1%3a2.7.4-0ubuntu1_all.deb ...  
 Unpacking git-core (1:2.7.4-0ubuntu1) ...  
 Selecting previously unselected package icu-devtools.  
 Preparing to unpack .../icu-devtools_55.1-7_amd64.deb ...  
 Unpacking icu-devtools (55.1-7) ...  
 Selecting previously unselected package libcurl4-openssl-dev:amd64.  
 Preparing to unpack .../libcurl4-openssl-dev_7.47.0-1ubuntu2.2_amd64.deb ...  
 Unpacking libcurl4-openssl-dev:amd64 (7.47.0-1ubuntu2.2) ...  
 Selecting previously unselected package libicu-dev:amd64.  
 Preparing to unpack .../libicu-dev_55.1-7_amd64.deb ...  
 Unpacking libicu-dev:amd64 (55.1-7) ...  
 Selecting previously unselected package libtinfo-dev:amd64.  
 Preparing to unpack .../libtinfo-dev_6.0+20160213-1ubuntu1_amd64.deb ...  
 Unpacking libtinfo-dev:amd64 (6.0+20160213-1ubuntu1) ...  
 Selecting previously unselected package libreadline6-dev:amd64.  
 Preparing to unpack .../libreadline6-dev_6.3-8ubuntu2_amd64.deb ...  
 Unpacking libreadline6-dev:amd64 (6.3-8ubuntu2) ...  
 Selecting previously unselected package libreadline-dev:amd64.  
 Preparing to unpack .../libreadline-dev_6.3-8ubuntu2_amd64.deb ...  
 Unpacking libreadline-dev:amd64 (6.3-8ubuntu2) ...  
 Selecting previously unselected package libsqlite3-dev:amd64.  
 Preparing to unpack .../libsqlite3-dev_3.11.0-1ubuntu1_amd64.deb ...  
 Unpacking libsqlite3-dev:amd64 (3.11.0-1ubuntu1) ...  
 Selecting previously unselected package zlib1g-dev:amd64.  
 Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-2ubuntu4_amd64.deb ...  
 Unpacking zlib1g-dev:amd64 (1:1.2.8.dfsg-2ubuntu4) ...  
 Selecting previously unselected package libssl-dev:amd64.  
 Preparing to unpack .../libssl-dev_1.0.2g-1ubuntu4.6_amd64.deb ...  
 Unpacking libssl-dev:amd64 (1.0.2g-1ubuntu4.6) ...  
 Selecting previously unselected package libssl-doc.  
 Preparing to unpack .../libssl-doc_1.0.2g-1ubuntu4.6_all.deb ...  
 Unpacking libssl-doc (1.0.2g-1ubuntu4.6) ...  
 Selecting previously unselected package libuv1:amd64.  
 Preparing to unpack .../libuv1_1.8.0-1_amd64.deb ...  
 Unpacking libuv1:amd64 (1.8.0-1) ...  
 Selecting previously unselected package libxml2-dev:amd64.  
 Preparing to unpack .../libxml2-dev_2.9.3+dfsg1-1ubuntu0.1_amd64.deb ...  
 Unpacking libxml2-dev:amd64 (2.9.3+dfsg1-1ubuntu0.1) ...  
 Selecting previously unselected package libxslt1-dev:amd64.  
 Preparing to unpack .../libxslt1-dev_1.1.28-2.1_amd64.deb ...  
 Unpacking libxslt1-dev:amd64 (1.1.28-2.1) ...  
 Selecting previously unselected package python-apt.  
 Preparing to unpack .../python-apt_1.1.0~beta1build1_amd64.deb ...  
 Unpacking python-apt (1.1.0~beta1build1) ...  
 Selecting previously unselected package python-pycurl.  
 Preparing to unpack .../python-pycurl_7.43.0-1ubuntu1_amd64.deb ...  
 Unpacking python-pycurl (7.43.0-1ubuntu1) ...  
 Selecting previously unselected package python-software-properties.  
 Preparing to unpack .../python-software-properties_0.96.20.5_all.deb ...  
 Unpacking python-software-properties (0.96.20.5) ...  
 Selecting previously unselected package sqlite3.  
 Preparing to unpack .../sqlite3_3.11.0-1ubuntu1_amd64.deb ...  
 Unpacking sqlite3 (3.11.0-1ubuntu1) ...  
 Selecting previously unselected package libffi-dev:amd64.  
 Preparing to unpack .../libffi-dev_3.2.1-4_amd64.deb ...  
 Unpacking libffi-dev:amd64 (3.2.1-4) ...  
 Selecting previously unselected package libyaml-dev:amd64.  
 Preparing to unpack .../libyaml-dev_0.1.6-3_amd64.deb ...  
 Unpacking libyaml-dev:amd64 (0.1.6-3) ...  
 Selecting previously unselected package nodejs.  
 Preparing to unpack .../nodejs_4.2.6~dfsg-1ubuntu4.1_amd64.deb ...  
 Unpacking nodejs (4.2.6~dfsg-1ubuntu4.1) ...  
 Processing triggers for man-db (2.7.5-1) ...  
 Processing triggers for install-info (6.1.0.dfsg.1-5) ...  
 Processing triggers for libc-bin (2.23-0ubuntu5) ...  
 Processing triggers for doc-base (0.10.7) ...  
 Processing 3 added doc-base files...  
 Setting up curl (7.47.0-1ubuntu2.2) ...  
 Setting up liberror-perl (0.17-1.2) ...  
 Setting up git-man (1:2.7.4-0ubuntu1) ...  
 Setting up git (1:2.7.4-0ubuntu1) ...  
 Setting up git-core (1:2.7.4-0ubuntu1) ...  
 Setting up icu-devtools (55.1-7) ...  
 Setting up libcurl4-openssl-dev:amd64 (7.47.0-1ubuntu2.2) ...  
 Setting up libicu-dev:amd64 (55.1-7) ...  
 Setting up libtinfo-dev:amd64 (6.0+20160213-1ubuntu1) ...  
 Setting up libreadline6-dev:amd64 (6.3-8ubuntu2) ...  
 Setting up libreadline-dev:amd64 (6.3-8ubuntu2) ...  
 Setting up libsqlite3-dev:amd64 (3.11.0-1ubuntu1) ...  
 Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-2ubuntu4) ...  
 Setting up libssl-dev:amd64 (1.0.2g-1ubuntu4.6) ...  
 Setting up libssl-doc (1.0.2g-1ubuntu4.6) ...  
 Setting up libuv1:amd64 (1.8.0-1) ...  
 Setting up libxml2-dev:amd64 (2.9.3+dfsg1-1ubuntu0.1) ...  
 Setting up libxslt1-dev:amd64 (1.1.28-2.1) ...  
 Setting up python-apt (1.1.0~beta1build1) ...  
 Setting up python-pycurl (7.43.0-1ubuntu1) ...  
 Setting up python-software-properties (0.96.20.5) ...  
 Setting up sqlite3 (3.11.0-1ubuntu1) ...  
 Setting up libffi-dev:amd64 (3.2.1-4) ...  
 Setting up libyaml-dev:amd64 (0.1.6-3) ...  
 Setting up nodejs (4.2.6~dfsg-1ubuntu4.1) ...  
 update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode  
 Processing triggers for libc-bin (2.23-0ubuntu5) ...  
 prawnhead@ubuntu:~$ cd  
 prawnhead@ubuntu:~$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv  
 Cloning into '/home/prawnhead/.rbenv'...  
 remote: Counting objects: 2595, done.  
 remote: Total 2595 (delta 0), reused 0 (delta 0), pack-reused 2595  
 Receiving objects: 100% (2595/2595), 475.80 KiB | 149.00 KiB/s, done.  
 Resolving deltas: 100% (1628/1628), done.  
 Checking connectivity... done.  
 prawnhead@ubuntu:~$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc  
 prawnhead@ubuntu:~$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc  
 prawnhead@ubuntu:~$ exec $SHELL  
 prawnhead@ubuntu:~$ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build  
 Cloning into '/home/prawnhead/.rbenv/plugins/ruby-build'...  
 remote: Counting objects: 7400, done.  
 remote: Total 7400 (delta 0), reused 0 (delta 0), pack-reused 7400  
 Receiving objects: 100% (7400/7400), 1.45 MiB | 128.00 KiB/s, done.  
 Resolving deltas: 100% (4487/4487), done.  
 Checking connectivity... done.  
 prawnhead@ubuntu:~$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc  
 prawnhead@ubuntu:~$ exec $SHELL  
 prawnhead@ubuntu:~$ rbenv install 2.4.0  
 Downloading ruby-2.4.0.tar.bz2...  
 -> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0.tar.bz2  
 Installing ruby-2.4.0...  
 Installed ruby-2.4.0 to /home/prawnhead/.rbenv/versions/2.4.0  
 prawnhead@ubuntu:~$ rbenv global 2.4.0  
 prawnhead@ubuntu:~$ ruby -v  
 ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]  
 prawnhead@ubuntu:~$ gem install bundler  
 Fetching: bundler-1.14.5.gem (100%)  
 Successfully installed bundler-1.14.5  
 Parsing documentation for bundler-1.14.5  
 Installing ri documentation for bundler-1.14.5  
 Done installing documentation for bundler after 3 seconds  
 1 gem installed  
 prawnhead@ubuntu:~$  

Configuring Git

Skipped.

Installing Rails (5.0.1)

 prawnhead@ubuntu:~$ cd  
 prawnhead@ubuntu:~$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -  
 [sudo] password for prawnhead:  
 ## Installing the NodeSource Node.js v4.x LTS Argon repo...  
 ## Populating apt-get cache...  
 + apt-get update  
 Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease  
 Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]  
 Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]    
 Get:4 http://security.ubuntu.com/ubuntu xenial-security/main amd64 DEP-11 Metadata [50.0 kB]  
 Get:5 http://security.ubuntu.com/ubuntu xenial-security/main DEP-11 64x64 Icons [39.7 kB]  
 Get:6 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]  
 Get:7 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [79.1 kB]  
 Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe i386 Packages [74.1 kB]  
 Get:9 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [485 kB]  
 Get:10 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 DEP-11 Metadata [32.1 kB]  
 Get:11 http://security.ubuntu.com/ubuntu xenial-security/universe DEP-11 64x64 Icons [37.0 kB]  
 Get:12 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [475 kB]  
 Get:13 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 DEP-11 Metadata [288 kB]  
 Get:14 http://us.archive.ubuntu.com/ubuntu xenial-updates/main DEP-11 64x64 Icons [188 kB]  
 Get:15 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [417 kB]  
 Get:16 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [409 kB]  
 Get:17 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [157 kB]  
 Get:18 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 DEP-11 Metadata [135 kB]  
 Get:19 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe DEP-11 64x64 Icons [165 kB]  
 Get:20 http://us.archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 DEP-11 Metadata [2,516 B]  
 Get:21 http://us.archive.ubuntu.com/ubuntu xenial-backports/main amd64 DEP-11 Metadata [3,324 B]  
 Fetched 3,345 kB in 6s (548 kB/s)                                    
 Reading package lists... Done  
 ## Confirming "xenial" is supported...  
 + curl -sLf -o /dev/null 'https://deb.nodesource.com/node_4.x/dists/xenial/Release'  
 ## Adding the NodeSource signing key to your keyring...  
 + curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -  
 OK  
 ## Creating apt sources list file for the NodeSource Node.js v4.x LTS Argon repo...  
 + echo 'deb https://deb.nodesource.com/node_4.x xenial main' > /etc/apt/sources.list.d/nodesource.list  
 + echo 'deb-src https://deb.nodesource.com/node_4.x xenial main' >> /etc/apt/sources.list.d/nodesource.list  
 ## Running `apt-get update` for you...  
 + apt-get update  
 Hit:1 http://security.ubuntu.com/ubuntu xenial-security InRelease  
 Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease  
 Hit:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease  
 Hit:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease  
 Get:5 https://deb.nodesource.com/node_4.x xenial InRelease [3,914 B]  
 Get:6 https://deb.nodesource.com/node_4.x xenial/main Sources [761 B]  
 Get:7 https://deb.nodesource.com/node_4.x xenial/main amd64 Packages [965 B]  
 Get:8 https://deb.nodesource.com/node_4.x xenial/main i386 Packages [965 B]  
 Fetched 6,605 B in 1s (3,543 B/s)  
 Reading package lists... Done  
 ## Run `apt-get install nodejs` (as root) to install Node.js v4.x LTS Argon and npm  
 prawnhead@ubuntu:~$ sudo apt-get install -y nodejs  
 Reading package lists... Done  
 Building dependency tree    
 Reading state information... Done  
 The following package was automatically installed and is no longer required:  
  libuv1  
 Use 'sudo apt autoremove' to remove it.  
 The following additional packages will be installed:  
  rlwrap  
 The following NEW packages will be installed:  
  rlwrap  
 The following packages will be upgraded:  
  nodejs  
 1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.  
 Need to get 8,630 kB of archives.  
 After this operation, 29.5 MB of additional disk space will be used.  
 Get:1 https://deb.nodesource.com/node_4.x xenial/main amd64 nodejs amd64 4.8.0-1nodesource1~xenial1 [8,555 kB]  
 Get:2 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 rlwrap amd64 0.41-1build1 [74.9 kB]  
 Fetched 8,630 kB in 1s (5,636 kB/s)                 
 Selecting previously unselected package rlwrap.  
 (Reading database ... 211356 files and directories currently installed.)  
 Preparing to unpack .../rlwrap_0.41-1build1_amd64.deb ...  
 Unpacking rlwrap (0.41-1build1) ...  
 Preparing to unpack .../nodejs_4.8.0-1nodesource1~xenial1_amd64.deb ...  
 Unpacking nodejs (4.8.0-1nodesource1~xenial1) over (4.2.6~dfsg-1ubuntu4.1) ...  
 Processing triggers for man-db (2.7.5-1) ...  
 Processing triggers for doc-base (0.10.7) ...  
 Processing 1 removed doc-base file...  
 Setting up rlwrap (0.41-1build1) ...  
 update-alternatives: using /usr/bin/rlwrap to provide /usr/bin/readline-editor (readline-editor) in auto mode  
 Setting up nodejs (4.8.0-1nodesource1~xenial1) ...  
 prawnhead@ubuntu:~$ gem install rails -v 5.0.1  
 Fetching: i18n-0.8.1.gem (100%)  
 Successfully installed i18n-0.8.1  
 Fetching: thread_safe-0.3.6.gem (100%)  
 Successfully installed thread_safe-0.3.6  
 Fetching: tzinfo-1.2.2.gem (100%)  
 Successfully installed tzinfo-1.2.2  
 Fetching: concurrent-ruby-1.0.5.gem (100%)  
 Successfully installed concurrent-ruby-1.0.5  
 Fetching: activesupport-5.0.1.gem (100%)  
 Successfully installed activesupport-5.0.1  
 Fetching: rack-2.0.1.gem (100%)  
 Successfully installed rack-2.0.1  
 Fetching: rack-test-0.6.3.gem (100%)  
 Successfully installed rack-test-0.6.3  
 Fetching: mini_portile2-2.1.0.gem (100%)  
 Successfully installed mini_portile2-2.1.0  
 Fetching: nokogiri-1.7.0.1.gem (100%)  
 Building native extensions. This could take a while...  
 Successfully installed nokogiri-1.7.0.1  
 Fetching: loofah-2.0.3.gem (100%)  
 Successfully installed loofah-2.0.3  
 Fetching: rails-html-sanitizer-1.0.3.gem (100%)  
 Successfully installed rails-html-sanitizer-1.0.3  
 Fetching: rails-dom-testing-2.0.2.gem (100%)  
 Successfully installed rails-dom-testing-2.0.2  
 Fetching: builder-3.2.3.gem (100%)  
 Successfully installed builder-3.2.3  
 Fetching: erubis-2.7.0.gem (100%)  
 Successfully installed erubis-2.7.0  
 Fetching: actionview-5.0.1.gem (100%)  
 Successfully installed actionview-5.0.1  
 Fetching: actionpack-5.0.1.gem (100%)  
 Successfully installed actionpack-5.0.1  
 Fetching: activemodel-5.0.1.gem (100%)  
 Successfully installed activemodel-5.0.1  
 Fetching: arel-7.1.4.gem (100%)  
 Successfully installed arel-7.1.4  
 Fetching: activerecord-5.0.1.gem (100%)  
 Successfully installed activerecord-5.0.1  
 Fetching: globalid-0.3.7.gem (100%)  
 Successfully installed globalid-0.3.7  
 Fetching: activejob-5.0.1.gem (100%)  
 Successfully installed activejob-5.0.1  
 Fetching: mime-types-data-3.2016.0521.gem (100%)  
 Successfully installed mime-types-data-3.2016.0521  
 Fetching: mime-types-3.1.gem (100%)  
 Successfully installed mime-types-3.1  
 Fetching: mail-2.6.4.gem (100%)  
 Successfully installed mail-2.6.4  
 Fetching: actionmailer-5.0.1.gem (100%)  
 Successfully installed actionmailer-5.0.1  
 Fetching: nio4r-1.2.1.gem (100%)  
 Building native extensions. This could take a while...  
 Successfully installed nio4r-1.2.1  
 Fetching: websocket-extensions-0.1.2.gem (100%)  
 Successfully installed websocket-extensions-0.1.2  
 Fetching: websocket-driver-0.6.5.gem (100%)  
 Building native extensions. This could take a while...  
 Successfully installed websocket-driver-0.6.5  
 Fetching: actioncable-5.0.1.gem (100%)  
 Successfully installed actioncable-5.0.1  
 Fetching: thor-0.19.4.gem (100%)  
 Successfully installed thor-0.19.4  
 Fetching: method_source-0.8.2.gem (100%)  
 Successfully installed method_source-0.8.2  
 Fetching: railties-5.0.1.gem (100%)  
 Successfully installed railties-5.0.1  
 Fetching: sprockets-3.7.1.gem (100%)  
 Successfully installed sprockets-3.7.1  
 Fetching: sprockets-rails-3.2.0.gem (100%)  
 Successfully installed sprockets-rails-3.2.0  
 Fetching: rails-5.0.1.gem (100%)  
 Successfully installed rails-5.0.1  
 Parsing documentation for i18n-0.8.1  
 Installing ri documentation for i18n-0.8.1  
 Parsing documentation for thread_safe-0.3.6  
 Installing ri documentation for thread_safe-0.3.6  
 Parsing documentation for tzinfo-1.2.2  
 Installing ri documentation for tzinfo-1.2.2  
 Parsing documentation for concurrent-ruby-1.0.5  
 Installing ri documentation for concurrent-ruby-1.0.5  
 Parsing documentation for activesupport-5.0.1  
 Installing ri documentation for activesupport-5.0.1  
 Parsing documentation for rack-2.0.1  
 Installing ri documentation for rack-2.0.1  
 Parsing documentation for rack-test-0.6.3  
 Installing ri documentation for rack-test-0.6.3  
 Parsing documentation for mini_portile2-2.1.0  
 Installing ri documentation for mini_portile2-2.1.0  
 Parsing documentation for nokogiri-1.7.0.1  
 Installing ri documentation for nokogiri-1.7.0.1  
 Parsing documentation for loofah-2.0.3  
 Installing ri documentation for loofah-2.0.3  
 Parsing documentation for rails-html-sanitizer-1.0.3  
 Installing ri documentation for rails-html-sanitizer-1.0.3  
 Parsing documentation for rails-dom-testing-2.0.2  
 Installing ri documentation for rails-dom-testing-2.0.2  
 Parsing documentation for builder-3.2.3  
 Installing ri documentation for builder-3.2.3  
 Parsing documentation for erubis-2.7.0  
 Installing ri documentation for erubis-2.7.0  
 Parsing documentation for actionview-5.0.1  
 Installing ri documentation for actionview-5.0.1  
 Parsing documentation for actionpack-5.0.1  
 Installing ri documentation for actionpack-5.0.1  
 Parsing documentation for activemodel-5.0.1  
 Installing ri documentation for activemodel-5.0.1  
 Parsing documentation for arel-7.1.4  
 Installing ri documentation for arel-7.1.4  
 Parsing documentation for activerecord-5.0.1  
 Installing ri documentation for activerecord-5.0.1  
 Parsing documentation for globalid-0.3.7  
 Installing ri documentation for globalid-0.3.7  
 Parsing documentation for activejob-5.0.1  
 Installing ri documentation for activejob-5.0.1  
 Parsing documentation for mime-types-data-3.2016.0521  
 Installing ri documentation for mime-types-data-3.2016.0521  
 Parsing documentation for mime-types-3.1  
 Installing ri documentation for mime-types-3.1  
 Parsing documentation for mail-2.6.4  
 Installing ri documentation for mail-2.6.4  
 Parsing documentation for actionmailer-5.0.1  
 Installing ri documentation for actionmailer-5.0.1  
 Parsing documentation for nio4r-1.2.1  
 Installing ri documentation for nio4r-1.2.1  
 Parsing documentation for websocket-extensions-0.1.2  
 Installing ri documentation for websocket-extensions-0.1.2  
 Parsing documentation for websocket-driver-0.6.5  
 Installing ri documentation for websocket-driver-0.6.5  
 Parsing documentation for actioncable-5.0.1  
 Installing ri documentation for actioncable-5.0.1  
 Parsing documentation for thor-0.19.4  
 Installing ri documentation for thor-0.19.4  
 Parsing documentation for method_source-0.8.2  
 Installing ri documentation for method_source-0.8.2  
 Parsing documentation for railties-5.0.1  
 Installing ri documentation for railties-5.0.1  
 Parsing documentation for sprockets-3.7.1  
 Installing ri documentation for sprockets-3.7.1  
 Parsing documentation for sprockets-rails-3.2.0  
 Installing ri documentation for sprockets-rails-3.2.0  
 Parsing documentation for rails-5.0.1  
 Installing ri documentation for rails-5.0.1  
 Done installing documentation for i18n, thread_safe, tzinfo, concurrent-ruby, activesupport, rack, rack-test, mini_portile2, nokogiri, loofah, rails-html-sanitizer, rails-dom-testing, builder, erubis, actionview, actionpack, activemodel, arel, activerecord, globalid, activejob, mime-types-data, mime-types, mail, actionmailer, nio4r, websocket-extensions, websocket-driver, actioncable, thor, method_source, railties, sprockets, sprockets-rails, rails after 42 seconds  
 35 gems installed  
 prawnhead@ubuntu:~$ rbenv rehash  
 prawnhead@ubuntu:~$ rails -v  
 Rails 5.0.1  
 prawnhead@ubuntu:~$   

Setting Up MySQL

Skipped.

Setting Up PostgreSQL

Skipped.

Final Steps

 prawnhead@ubuntu:~$ rails new myapp  
    create   
    create README.md  
    create Rakefile  
    create config.ru  
    create .gitignore  
    create Gemfile  
    create app  
    create app/assets/config/manifest.js  
    create app/assets/javascripts/application.js  
    create app/assets/javascripts/cable.js  
    create app/assets/stylesheets/application.css  
    create app/channels/application_cable/channel.rb  
    create app/channels/application_cable/connection.rb  
    create app/controllers/application_controller.rb  
    create app/helpers/application_helper.rb  
    create app/jobs/application_job.rb  
    create app/mailers/application_mailer.rb  
    create app/models/application_record.rb  
    create app/views/layouts/application.html.erb  
    create app/views/layouts/mailer.html.erb  
    create app/views/layouts/mailer.text.erb  
    create app/assets/images/.keep  
    create app/assets/javascripts/channels  
    create app/assets/javascripts/channels/.keep  
    create app/controllers/concerns/.keep  
    create app/models/concerns/.keep  
    create bin  
    create bin/bundle  
    create bin/rails  
    create bin/rake  
    create bin/setup  
    create bin/update  
    create config  
    create config/routes.rb  
    create config/application.rb  
    create config/environment.rb  
    create config/secrets.yml  
    create config/cable.yml  
    create config/puma.rb  
    create config/spring.rb  
    create config/environments  
    create config/environments/development.rb  
    create config/environments/production.rb  
    create config/environments/test.rb  
    create config/initializers  
    create config/initializers/application_controller_renderer.rb  
    create config/initializers/assets.rb  
    create config/initializers/backtrace_silencers.rb  
    create config/initializers/cookies_serializer.rb  
    create config/initializers/cors.rb  
    create config/initializers/filter_parameter_logging.rb  
    create config/initializers/inflections.rb  
    create config/initializers/mime_types.rb  
    create config/initializers/new_framework_defaults.rb  
    create config/initializers/session_store.rb  
    create config/initializers/wrap_parameters.rb  
    create config/locales  
    create config/locales/en.yml  
    create config/boot.rb  
    create config/database.yml  
    create db  
    create db/seeds.rb  
    create lib  
    create lib/tasks  
    create lib/tasks/.keep  
    create lib/assets  
    create lib/assets/.keep  
    create log  
    create log/.keep  
    create public  
    create public/404.html  
    create public/422.html  
    create public/500.html  
    create public/apple-touch-icon-precomposed.png  
    create public/apple-touch-icon.png  
    create public/favicon.ico  
    create public/robots.txt  
    create test/fixtures  
    create test/fixtures/.keep  
    create test/fixtures/files  
    create test/fixtures/files/.keep  
    create test/controllers  
    create test/controllers/.keep  
    create test/mailers  
    create test/mailers/.keep  
    create test/models  
    create test/models/.keep  
    create test/helpers  
    create test/helpers/.keep  
    create test/integration  
    create test/integration/.keep  
    create test/test_helper.rb  
    create tmp  
    create tmp/.keep  
    create tmp/cache  
    create tmp/cache/assets  
    create vendor/assets/javascripts  
    create vendor/assets/javascripts/.keep  
    create vendor/assets/stylesheets  
    create vendor/assets/stylesheets/.keep  
    remove config/initializers/cors.rb  
      run bundle install  
 The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.  
 Fetching gem metadata from https://rubygems.org/..........  
 Fetching version metadata from https://rubygems.org/..  
 Fetching dependency metadata from https://rubygems.org/.  
 Resolving dependencies...  
 Using rake 12.0.0  
 Using concurrent-ruby 1.0.5  
 Using i18n 0.8.1  
 Using minitest 5.10.1  
 Using thread_safe 0.3.6  
 Using builder 3.2.3  
 Using erubis 2.7.0  
 Using mini_portile2 2.1.0  
 Using rack 2.0.1  
 Using nio4r 2.0.0  
 Using websocket-extensions 0.1.2  
 Using mime-types-data 3.2016.0521  
 Using arel 7.1.4  
 Using bundler 1.14.5  
 Using byebug 9.0.6  
 Using coffee-script-source 1.12.2  
 Using execjs 2.7.0  
 Using method_source 0.8.2  
 Using thor 0.19.4  
 Using debug_inspector 0.0.2  
 Using ffi 1.9.18  
 Using multi_json 1.12.1  
 Using rb-fsevent 0.9.8  
 Using puma 3.7.1  
 Using sass 3.4.23  
 Using tilt 2.0.6  
 Using sqlite3 1.3.13  
 Using turbolinks-source 5.0.0  
 Using tzinfo 1.2.2  
 Using nokogiri 1.7.0.1  
 Using rack-test 0.6.3  
 Using sprockets 3.7.1  
 Using websocket-driver 0.6.5  
 Using mime-types 3.1  
 Using coffee-script 2.4.1  
 Using uglifier 3.1.4  
 Using rb-inotify 0.9.8  
 Using turbolinks 5.0.1  
 Using activesupport 5.0.2  
 Using loofah 2.0.3  
 Using mail 2.6.4  
 Using listen 3.0.8  
 Using rails-dom-testing 2.0.2  
 Using globalid 0.3.7  
 Using activemodel 5.0.2  
 Using jbuilder 2.6.3  
 Using spring 2.0.1  
 Using rails-html-sanitizer 1.0.3  
 Using activejob 5.0.2  
 Using activerecord 5.0.2  
 Using spring-watcher-listen 2.0.1  
 Using actionview 5.0.2  
 Using actionpack 5.0.2  
 Using actioncable 5.0.2  
 Using actionmailer 5.0.2  
 Using railties 5.0.2  
 Using sprockets-rails 3.2.0  
 Using coffee-rails 4.2.1  
 Using jquery-rails 4.2.2  
 Using web-console 3.4.0  
 Using rails 5.0.2  
 Using sass-rails 5.0.6  
 Bundle complete! 15 Gemfile dependencies, 62 gems now installed.  
 Use `bundle show [gemname]` to see where a bundled gem is installed.  
      run bundle exec spring binstub --all  
 * bin/rake: spring inserted  
 * bin/rails: spring inserted  
 prawnhead@ubuntu:~$ cd myapp  
 prawnhead@ubuntu:~/myapp$ rails s  
 => Booting Puma  
 => Rails 5.0.2 application starting in development on http://localhost:3000  
 => Run `rails server -h` for more startup options  
 Puma starting in single mode...  
 * Version 3.7.1 (ruby 2.4.0-p0), codename: Snowy Sagebrush  
 * Min threads: 5, max threads: 5  
 * Environment: development  
 * Listening on tcp://localhost:3000  
 Use Ctrl-C to stop  


Please comment if you had issues and I'll try to help. In my next post I'll go through some basics of creating rails apps and how to use them. They really are awesome. It's hard not to be impressed with how much power Ruby on Rails gives you for so little work.

That is all.

Comments

Post a Comment