More Related Content
More from Shugo Numano (15)
Heroku
- 4. PaaS事業者
• 海外
• GAE
• AWS
Elastic Beanstalk
• Azure
• Force.com
• EngineYard
• dotcloud
• 日本
• IIJ Mogok
• Nifty C4SA
• Cloudn PaaS
• その他
• CloudFoundry
• OpenShift
- 7. Heroku demo
• Ruby on Rails
• $rails new bookstore -d postgresql #PostgreSQLを使用
• $cd bookstore
• config/database.ymlを編集。development,testにid,pwを設定。
• rake db:create
• $rails generate scaffold book isbn:string title:string price:integer
• $rake db:migrate #db/migrate/xxx_create_books.rbにてtable作成
• $rails server
• http://localhost:3000でアクセス可能。defaultのrailsの画面
• $rm public/index.html
• config/routes.dbを編集。下記を追記。
root :to => ‘books#index’
• 再度アクセス
• $rails dbconsole
- 8. Heroku demo(con’t)
• git
• git init
• git add .
• git commit -m ‘init’
• heroku
• heroku login
• heroku create
• git push heroku master
• heroku run rake db:migrate
• heroku open #ブラウザでサービスにアクセス
• heroku pg:psql #Heroku上のDBに接続
• heroku config #DB情報
• heroku logs