- ruby 1.9.2
- rails 3.2.1
rails new sample`
cd sample
rails g scaffold item name:string body:text price:integer
rails g controller top index
rake db:migrate
「index.html」=>「_____index.html」
config/routes.rb
root :to => "top#index"
...
match ':controller(/:action(/:id))(.:format)'
rails s
development 環境でのみ sqlite3 を利用
group :development do
gem 'sqlite3'
end
production 環境では Heroku の DBを利用
group :production do
gem 'pg'
end
bundle install --without production
rake assets:precompile
git init
git add . && git commit -m "first commit"
git status
heroku create sample
git push heroku master
heroku run rake db:migrate
heroku open
rake assets:precompile
git add . && git commit -m "update"
git push heroku master
heroku rake db:migrate
heroku open