Heroku deploy Rails in 5 minutes
In this post I will show, how you can easily getting started to deploy your Ruby on Rails project in Heroku. Heroku is free cloud platform as service (PaaS), and they bet to easily project deployment service.
This guide is helpful only for those who are trying Heroku at first time! We will skip Active Record begin on this project, when we could better only test Heroku for Rails.
If you are not yet registered to Heroku, do it now:
https://id.heroku.com/signup.
I was using Ruby 1.9.3p484 and Rails 4.0.0 on Ubuntu 13.10 64-bit.
1. Create new Rails project
And generate welcome controller with index action:
Add to root routing from config/routes.rb:
Uncomment next line:
Heroku require that you modify little bit your project /bin files (bundle, rails, rake) shebang.
Change:
to
1.1. Heroku Procfile
Create new Procfile on project root for Heroku:
And write next code in file Procfile:
1.2. Initialize Git
Do first commit:
2. Heroku
Is time to install heroku toolbelt:
Login to Heroku:
2.1. Create new Heroku app
Push your project to Heroku:
3. Test
Open your Heroku App to browser:
If your browser opened page looks like next:
You are successfully deploy your Rails app in Heroku!
Source
https://toolbelt.heroku.com/
https://devcenter.heroku.com/articles/getting-started-with-rails4