#Ruby on Rails Office Hours - Session 2 ##Brewing your own server with Chef and Capistrano on Digital Ocean
Google hangout: http://www.youtube.com/watch?v=3W4kXyZWDJA
Real time chat: http://tlk.io/ror-study-group
Chef Notes: https://github.com/intercity/chef-repo
-
Create a droplet on Digital Ocean
-
Install Chef on your computer:
cd ~/Sites/ git clone [email protected]:ror-study-group/chef-repo.git cd chef-repo rbenv install 2.0.0-p247 gem install bundler bundle install
-
Configure and Deploy your server environment:
bundle exec knife solo prepare root@<ip-address> cp nodes/sample_host.json nodes/<ip-address>.json #Fill in appropriate information bundle exec knife solo cook root@<ip-address>
-
Create Rails app:
rails new ror-study-group cd ror-study-group git init . git add . git commit -m "Initial rails install" vi Gemfile #add MySQL rails g scaffold message_board title:string body:text rake db:migrate git add . git commit -m "Adding message board support" git remote add origin [email protected]:bswinnerton/ror-study-group.git git push origin master
-
Add Capistrano to app:
rbenv local 2.0.0-p247 echo "\ngem 'unicorn'\ngem 'capistrano', '~> 2.15'" >> Gemfile bundle install bundle binstub unicorn bundle exec capify . vi Capfile #uncomment deploy/assets vi config/deploy.rb #https://github.com/intercity/chef-repo git add . git commit -m "Adding production support" git push origin master
-
Prepare Capistrano
bundle exec cap deploy:setup bundle exec cap deploy:check bundle exec cap deploy:cold