Skip to content

Instantly share code, notes, and snippets.

@selfup
Last active December 27, 2015 23:13
Show Gist options
  • Save selfup/8552639296105b464750 to your computer and use it in GitHub Desktop.
Save selfup/8552639296105b464750 to your computer and use it in GitHub Desktop.

Clone my repo:

cd
git clone https://github.com/selfup/DevOpsOne.git

Clone your favorite app and go into the directory of your app:

cd favorite_app_directory

Run the ruby script that will take a command line argument after the .rb

This will set up a valid database.yml for you (the most painfull process of hooking up a rails app)

For Ubuntu server

ruby ~/DevOpsOne/create_db_yml_server.rb a_password_you_will_remember

For Ubuntu Desktop

ruby ~/DevOpsOne/create_db_yml_desktop.rb a_password_you_will_remember

For Ubuntu Vagrant VM

ruby ~/DevOpsOne/create_db_yml_vagrant.rb a_password_you_will_remember

Please check your .gitignore and run git status to make sure the script properly added the correct files to your .gitignore

Now we go into the postgres console and input the password we gave to the ruby script as an ARGV[0]

sudo -u postgres psql
\password name_of_favorite_app
\q

Now you can run development/test/production

rake db:setup
RAILS_ENV=production rake db:setup
RAILS_ENV=production rake assets:precompile
RAILS_ENV=production rails s

All done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment