_ Prerequisite
_ Install&Setup
_ Prepare Heroku's development environment
- Step.1
- Access to Heroku's web site.
- Step.2
- Login the system.
- Step.3
- Click the Ruby's icon, and you will see the instruction how to install Heroku Toolbelt.
- Step.4
- Install bundler to your environment.
$ gem install bundler
- Step.5
- Download Heroku Toolbelt from the link in web page.
_ HowToUse
_ Create rails project
- Step.1
- Login to Heroku server.
$ heroku login
- Step.2
- Create new rails project.
$ rails new <project name> --database=postgresql
- Step.3
- Create new controller for welcome page.
$ rails generate controller welcome
- Step.4
- Create welcome page.
$ vi app/views/welcome/index.html.erb
<h2>Hello World</h2>
<p>
<%= Time.now %>
</p>
- Step.5
- Config routing setting
$ vi config/routes.rb
root 'welcome#index'
- Step.6
- Check if it can run in local environment.
$ rails s
- Step.7
- Create new project in Heroku space.
$ heroku create
- Step.8
- Deploy the sample project to Heroku server.
$ git init
$ git add .
$ git commit -m "initial checkin"
$ git push heroku master
Then you can access your application.
_ Connect Database
- Step.1
- Migrate database
$ heroku run rake db:migrate
_ Author
S.Yatsuzuka