SyntaxHighlighter JS


Packer and package installs

When using Packer to generate an Ubuntu AWS AMI, I use a shell script provisioner to install and update packages via apt-get. When executing apt commands in the script, I was getting the errors such as: 
"Package has no installation candidate"
"Unable to locate package" 

The error in the shell script was that I was executing apt-get commands before the AWS cloud-init completed.

To check that cloud-init finished before running apt-get, modify the script via

while [ ! -f  /var/lib/cloud/instance/boot-finished ];
    echo "Waiting for cloud-init to finish ..."
    sleep 2

apt-get update -y
apt-get install -y package


Ruby on Rails json LoadError

Running Ruby on Rails 'bin/rails s' and you get an error

in require: cannot load such file -- json (LoadError)

Edit the Gemfile and add

gem 'json'

Installing Ruby on Rails on AWS Linux

To install Ruby on Rails on the AWS Linux VM, you need to install some prerequisites first.

sudo su -
yum install -y ruby24
alternatives --set ruby /usr/bin/ruby2.4
yum install -y ruby24-devel rubygems ruby24-devel gcc zlib-devel patch sqlite-devel
curl -sL | bash -
yum install -y nodejs

gem install rails
rails --version


Add hard disk to VMware CentOS 7 VM

There are two easy steps to add a hard disk for a a VMware CentOS 7 VM

  1.  Assign a new hard disk in VMware vSphere
  2.  Configure the new hard disk in CentOS
See the full picture tutorial at