The scripts in this repository provision an AWS Ubuntu Server 14.04 EC2 instance during Launch. The scripts install Ruby, Rails, and other important tools required for starting a Ruby on Rails project. No heavy-weight HTTP or DB servers are installed, such as Apache/NGINX or MySQL/PostgreSQL. In addition to installing Ruby/Rails/etc, a script performs minor modification to two .bashrc files to "improve" the command line prompt for the users root and ubuntu.
Provisioning works on an AWS t2.nano, (512MB), or larger. After provisioning, 6GB of storage free-space is available on an 8GB EBS volume.
-
Begin the Launch of an AWS Ubuntu Server 14.04 AMI EC2 instance using the EC2 Dashboard.
-
On the page labeled "Step 3: Configure Instance Details", set options per your needs, then select the button labeled Advanced Details. Notice the User Data edit box which immediately drops down after button selection.
-
Atop the User Data edit box, ensure the "As text" radio button is selected. In the User Data edit box, paste the contents of the script file ec2-ruby-rails.sh.
-
Continue with Launch per usual on subsequent Launch pages.
The ec2-ruby-rails.sh script provisions Ruby/Rails immediately after EC2 launch. Provisioning adds approximately ten minutes to normal Launch time.
To verify successful Ruby/Rails installation, log into the EC2 instance, and inspect the version numbers of the installed software, as follows :
$ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
$ gem --version
2.5.1
$ bundler --version
Bundler version 1.12.5
$ rails --version
Rails 5.0.0
$ nodejs --version
v0.10.25
$ git --version
git version 1.9.1
After provisioning is complete, reboot the EC2 instance.
Take care to not reboot before provisioning finishes. To determine if provisioning has completed, log into the EC2 instance, then "tail" the provision log file. The last line of the log file indicates provisioning has completed :
$ tail /home/ubuntu/arr-provision.log
.
.
.
END ec2-ruby-rails.sh
Now, reboot!